产品类: public class Product:NotificationObject { private int productID; public int ProductID { get { return productID; } set { productID = value; this.RaisePropertyChanged(()=>this.ProductID); } } private string productName; public string ProductName {
原文:自定义Behavior 实现Listbox自动滚动到选中项 blend为我们提供方便的behavior来扩展我们的控件,写好之后就可以在blend中方便的使用了. 下面是自定义的behavior来实现Listbox自动滚动到选中项 其中this.AssociatedObject为使用该行为的控件. 其中 OnAttached()和OnDetaching()为必须重写的内容,通常可以在OnAttched()里面添加事件处理程序,来达到拓展的目的. public class AutoScrol
原文:ArcGIS API for Silverlight 当DataGrid选中项时,地图聚焦弹出窗口,并可以播放音频文件 先看效果图,然后上代码: <UserControl x:Class="MapClient.PicMusic" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx
How to avoid WPF TreeView SelectedItemChanged being called twice Very often, we need to execute some code in SelectedItemChanged depending on the selected TreeViewItem. But SelectedItemChanged is called twice. This is due to stealing focus from the m