自由国度

.Net、C#、WPF、Silverlight、HTML5、JavaScript等,好好写代码。

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

随笔分类 -  WPF

Windows Presentation Foundation
摘要:Window.DragMove 方法①允许使用在窗口工作区的暴露区域上方按下其鼠标左键的鼠标来拖动窗口。②调用 DragMove 时必须按下鼠标左键。 检测何时按下鼠标左键的一种方法是处理 MouseLeftButtonDown 事件。 ③调用 DragMove 时,必须在窗口工作区的暴露区域上方按下鼠标左键。 ④当窗口承载在浏览器中时,不能调用此方法。实例代码: 阅读全文
posted @ 2010-12-04 17:21 彬子 阅读(1792) 评论(0) 推荐(0)

摘要:这段代码是用于做导航选项的,项目中暂时不用放在这里以备以后查阅。ConfigUIManage _uiManage = new ConfigUIManage(); IList<Button> btnlist = new List<Button>(); Button currentBtn = null; /// <summary> /// 初始化,控制栏 /// &... 阅读全文
posted @ 2010-10-28 15:46 彬子 阅读(295) 评论(0) 推荐(0)

摘要:public static class HxTimer { static System.Windows.Threading.DispatcherTimer _LockSreenTimer = new System.Windows.Threading.DispatcherTimer(); public static System.Windows.Threading.DispatcherTimer L... 阅读全文
posted @ 2010-10-26 11:54 彬子 阅读(1238) 评论(0) 推荐(0)

摘要:原文在.Net中有不少计时器,包括:1.System.Threading.Timer2.System.Timers.Timer3.System.Windows.Forms.Timer4.System.Web.UI.Timer5.System.Windows.Threading.DispatcherTimer其中第四个主要用于web开发中;第一个和第二个的触发事件和UI处于不同的线程,因此如果使用它们的触发事件来改变UI,会发生对象被占用的异常;第三个是WinForm的计时器,在WPF中也可以使用,不过必须添加System.Windows.Forms的引用;第五个是WPF自己的计时器,一般在WP 阅读全文
posted @ 2010-10-25 21:44 彬子 阅读(3021) 评论(0) 推荐(0)

摘要://验证输入为数字 private void txt_time_KeyDown(object sender, KeyEventArgs e) { if (!((e.Key >= Key.D0 && e.Key <= Key.D9) || (e.Key >= Key.NumPad0 && e.Key <= Key.NumPad9))) { e.... 阅读全文
posted @ 2010-10-25 15:07 彬子 阅读(7564) 评论(0) 推荐(0)

摘要:①BitmapImage source = Application.Current.Resources["OrganImage"] as BitmapImage;②BitmapImage source = this.FindResource("OrganImage") as BitmapImage;BitmapImage source = this.TryFindResource("OrganIm... 阅读全文
posted @ 2010-10-15 12:45 彬子 阅读(1587) 评论(0) 推荐(1)

摘要:①:启动程序引用附属项目的资源  [pack://application:,,,/MyProject;component/Window1.xaml]或[/MyProject;component/Window1.xaml]  [pack://application:,,,/MyProject;component/Image/advancedsettings.png]或[/MyProject;component/Image/advancedsettings.png]②:附属项目引用启动项目的资源  [pack://application:,,,/Image/system_upgrade.png]或 阅读全文
posted @ 2010-10-14 15:41 彬子 阅读(1522) 评论(0) 推荐(0)

摘要:<TreeView Grid.Column="0" Margin="3,3,0,3" Name="GroupList"> <TreeView.ItemTemplate> <HierarchicalDataTemplate ItemsSource="{Binding GList}"> <TextBlock Text="{Binding Name}" />... 阅读全文
posted @ 2010-09-17 17:17 彬子 阅读(3500) 评论(1) 推荐(0)

摘要:Dispatcher.Invoke(new EventHandler(this.ShowSchemeInfo), sender, e); 阅读全文
posted @ 2010-08-12 10:04 彬子 阅读(320) 评论(0) 推荐(0)

摘要:原文:http://tech.ddvip.com/2009-07/1248427254126248.html  1, 前提  可以说MVVM是专为WPF打造的模式, 也可以说MVVM仅仅是MVC的一个变种, 但无论如何, 就实践而言, 如果你或你的团队没有使用"Binding"的习惯, 那么研究MVVM就没有多大意义.  另外,个人觉得, 使用Command以及打造一种合理的简化的方式去使用Com... 阅读全文
posted @ 2010-07-15 17:04 彬子 阅读(1053) 评论(0) 推荐(0)