随笔分类 -  WPF

摘要:1.使用ResourceManagerstring st = Properties.Resources.ResourceManager.GetString(tableName);value = Properties.Resources.ResourceManager.GetObject(fileNa... 阅读全文
posted @ 2015-03-11 18:40 马语者 阅读(1907) 评论(0) 推荐(0) 编辑
摘要:若想实现仅在TabControl中的Tab中添加右键菜单,可在XAML中通过使用样式得到: 但是上面的菜单执行CLICK事件时会无效。把菜单放到控件资源里就好了: ... 阅读全文
posted @ 2015-03-06 19:11 马语者 阅读(2260) 评论(0) 推荐(1) 编辑
摘要:Path形状获取字符串型变量数据:var path = new Path();path.Data = Geometry.Parse("M 100,200 C 100,25 400,350 400,175 H 280"); 阅读全文
posted @ 2015-03-06 10:21 马语者 阅读(344) 评论(0) 推荐(0) 编辑
摘要:When you want to make an object binding-aware you have two choices : implements INotifyPropertyChanged or creates DependencyProperties. Which one is the best ? Let's try to answer this question !How t... 阅读全文
posted @ 2015-03-03 15:10 马语者 阅读(781) 评论(0) 推荐(0) 编辑
摘要:Optimizing Performance: Data Binding .NET Framework 4.5 Other Versions Windows Presentation Foundation (WPF) data binding provides a simple and consistent way for applications to present and int... 阅读全文
posted @ 2015-03-03 15:08 马语者 阅读(215) 评论(0) 推荐(0) 编辑
摘要:写在前面:本文为即兴而作,因此难免有疏漏和词不达意的地方。在这里,非常期望您提供评论,分享您的想法和建议。 这是一篇介绍如何在WPF中实现拖放功能的短文。 首先要读者清楚的一件事情是:拖放主要分为拖放源和拖放目标两个组成。拖放源和拖放目标各自拥有不同的事件。软件开发人员需要在适当的事件中完成相应功能。 试想拖放是如何操作的:用户选中一个界面元素,并在鼠标左键按下的情况下移动鼠标... 阅读全文
posted @ 2015-02-05 16:41 马语者 阅读(1409) 评论(0) 推荐(0) 编辑
摘要:The Scenario I want to do a master detail like scenario where the selection in one ComboBox cell will update the list of items in the next ComboBox cell and so on. Setting up the DataSource and Vi... 阅读全文
posted @ 2015-01-28 15:31 马语者 阅读(1333) 评论(0) 推荐(0) 编辑
摘要:Introduction Since .NET 4.0, Microsoft is shipping a DataGrid control that provides all the basic functionality needed, like: Auto generation of columns Manual definition of columns Sel... 阅读全文
posted @ 2015-01-28 15:29 马语者 阅读(2331) 评论(0) 推荐(0) 编辑
摘要:MultiLevelMultiSelectCombo (Silverlight) Tharindu Nishad Patikirikorala, 14 Aug 2013 CPOL 5.00 (1 vote) Rate: vote 1vote 2vote 3vote 4vote 5 The MultiLevelMultiSelectCombo is an extension of ... 阅读全文
posted @ 2015-01-26 14:24 马语者 阅读(437) 评论(0) 推荐(0) 编辑
摘要:var intersectionDetail = path1.Data.FillContainsWithDetail(path2.Data); if (intersectionDetail != IntersectionDetail.NotCalculated && intersectionDetail != IntersectionDetail.Empty) { ... 阅读全文
posted @ 2015-01-20 14:52 马语者 阅读(803) 评论(0) 推荐(0) 编辑
摘要:We can use the Arc XAML element to draw arcs in XAML. Besides drawing arcs using the Arc element, we can also use the ArcSegment element. The ArcSegment is useful when an arc becomes a part of a graph... 阅读全文
posted @ 2015-01-16 15:55 马语者 阅读(1934) 评论(0) 推荐(1) 编辑
摘要:直接用{Binding} 就可以了,如下: ... 阅读全文
posted @ 2015-01-07 14:54 马语者 阅读(2128) 评论(0) 推荐(0) 编辑
摘要:if (TypeDescriptor.GetProperties(this)[propertyName] == null) { Debug.Fail("无效属性名称: " + propertyName); } 阅读全文
posted @ 2015-01-05 17:59 马语者 阅读(257) 评论(0) 推荐(0) 编辑
摘要:Image transformation is a process of rotating and scaling images. Rotating Images There are two ways to rotate an image. First option is to use the Rotation property of BitmapImage and second option... 阅读全文
posted @ 2014-12-25 09:03 马语者 阅读(329) 评论(0) 推荐(0) 编辑
摘要:In my recent codeproject article on the DataGrid I described a number of techniques for handling the updates to DataTables which are bound to the grid. These examples all worked on the assumption that... 阅读全文
posted @ 2014-12-23 22:01 马语者 阅读(649) 评论(0) 推荐(0) 编辑
摘要:I can assure you: SelectedItems is indeed bindable as a XAML CommandParameter After a lot of digging and googling, I have finally found a simple solution to this common issue. To make it work you mu... 阅读全文
posted @ 2014-12-23 19:30 马语者 阅读(2109) 评论(0) 推荐(0) 编辑
摘要:As we saw in the previous chapters, the way to manipulate the output of a binding before is shown is typically through the use of a converter. The cool thing about the converters is that they allow yo... 阅读全文
posted @ 2014-12-21 12:08 马语者 阅读(248) 评论(0) 推荐(0) 编辑
摘要:public class SendCommand : ICommand { public void Execute(object parameter) { var labels = ((object[]) parameter).OfType(); } public bool CanExecute(object parameter) ... 阅读全文
posted @ 2014-12-03 15:23 马语者 阅读(1228) 评论(0) 推荐(0) 编辑
摘要:解决办法是在控件初始化时,通过下面方法再次加载图片: ucCanvas.CreateCoordinateImage.Source = GetImageIcon(global::MainApplication.Properties.Resources.DL_Coordinate2); private static BitmapImage GetImageIcon(System.Dr... 阅读全文
posted @ 2014-12-02 17:22 马语者 阅读(2209) 评论(0) 推荐(0) 编辑
摘要:Posted: June 30, 2013 | Filed under: MVVM, WPF, XAML |1 Comment In a WPF application that uses the MVVM (Model-View-ViewModel) design pattern, the view model is the component that is responsible fo... 阅读全文
posted @ 2014-12-02 11:21 马语者 阅读(414) 评论(0) 推荐(0) 编辑