
WPF
JeffreyGoogle
这个作者很懒,什么都没留下…
展开
-
WPF里面多线程访问UI线程、主线程的控件
如果出现以下错误:调用线程无法访问此对象,因为另一个线程拥有该对象。你就碰到多线程访问UI线程、主线程的控件的问题了。先占位。原创 2017-01-23 20:52:08 · 1495 阅读 · 0 评论 -
ContextMenuStrip 类
表示快捷菜单 命名空间: System.Windows.Forms程序集: System.Windows.Forms(位于 System.Windows.Forms.dll)继承层次结构System.Object System.MarshalByRefObject System.ComponentModel.Component System.Wi原创 2017-01-23 20:51:12 · 418 阅读 · 0 评论 -
在WPF中使用WinForm控件方法
1、 首先添加对如下两个dll文件的引用:WindowsFormsIntegration.dll,System.Windows.Forms.dll。2、 在要使用WinForm控件的WPF窗体的XAML文件中添加如下内容: 即: xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Fo原创 2017-01-23 20:51:16 · 947 阅读 · 0 评论 -
WPF中弹出菜单
在WPF里弹出菜单是用Popup,你那个右键的是上下文菜单(也就是快捷菜单)。 Grid> Button x:Name="BtnPop" Width="100" Height="30" HorizontalAlignment="Left" VerticalAlignment="Bottom" Content="Popup" Click="BtnPop_Click"/>原创 2017-01-23 20:51:19 · 1097 阅读 · 0 评论 -
WPF菜单
1、MenuMenu 是水平放置它的项的,默认情况下把灰色栏作为背景。把Menu 添加到它的ItemsControl 基类的唯一公开的API 是IsMainMenu 属性。当为true(默认的)时,用户按下Alt 或者F10 键,菜单获得焦点。MenuItem 是带头的Items 控件(继承自HeaderedItemControl),它的头实际上是主对象。如果Items 是子元素的话就原创 2017-01-23 20:51:22 · 1253 阅读 · 0 评论 -
WPF相关开源项目
MahApps排名第一的是MahApps框架。该框架不错。详细信息请去官网。 cefsharp 能让你在应用中嵌入谷歌浏览器页xaml-sdk 包含很多开发实例PrismPrism is a framework for building loosely coupled, maintainable, and testable XAML applications in WPF, W原创 2017-01-23 20:51:36 · 4511 阅读 · 0 评论 -
WPF获取应用程序启动目录的方法
1、AppDomain.CurrentDomain.BaseDirectory using System;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { Console.WriteLine(AppDoma原创 2017-01-23 20:51:38 · 2232 阅读 · 0 评论 -
WPF 中的image控件的Source如何赋值
Image image=new Image();image.Source = new BitmapImage(new Uri(@"daw\adw.jpg",UriKind.Relative));原创 2017-01-23 20:51:43 · 10482 阅读 · 0 评论 -
WPF:MVVM模式下ViewModel关闭View
不外乎两种基本方法。消息通知和参数传递。一、消息通知利用View里的IsEnable属性原理是这样的:1、UI中的IsEnabled绑定VM中的属性2、UI的后台代码中,注册IsEnableChange事件,在这个事件里,检测到传过来的值满足某个条件,即可触发Close()命令如此,VM控制自己那个属性就能达到关闭V的目的了。二、参数传递。根据参数传递的不同。分为传递函数和传递V原创 2017-01-23 20:51:58 · 1469 阅读 · 0 评论 -
ToolStripMenuItem
MenuStrip 类MenuStrip 被取代的顶级容器 MainMenu。">MenuStrip is the top-level container that supersedes MainMenu.">为窗体提供菜单系统。继承层次结构System.Object System.MarshalByRefObject System.ComponentModel.Component原创 2017-01-23 20:51:09 · 1137 阅读 · 0 评论