读书人

[Silverlight入门系列]施用MVVM模式(7

发布时间: 2012-10-30 16:13:36 作者: rapoo

[Silverlight入门系列]使用MVVM模式(7):ViewModel的INotifyPropertyChanged接口实现

上一篇说到《Model的INotifyPropertyChanged接口实现》和在Prism中有《NotificationObject自动实现INotifyPropertyChanged接口》,很好,本文说说ViewModel的这个INotifyPropertyChanged接口可以用来做啥?

[Silverlight入门系列]施用MVVM模式(7):ViewModel的INotifyPropertyChanged接口实现[Silverlight入门系列]施用MVVM模式(7):ViewModel的INotifyPropertyChanged接口实现[Silverlight入门系列]施用MVVM模式(7):ViewModel的INotifyPropertyChanged接口实现[Silverlight入门系列]施用MVVM模式(7):ViewModel的INotifyPropertyChanged接口实现[Silverlight入门系列]施用MVVM模式(7):ViewModel的INotifyPropertyChanged接口实现[Silverlight入门系列]施用MVVM模式(7):ViewModel的INotifyPropertyChanged接口实现[Silverlight入门系列]施用MVVM模式(7):ViewModel的INotifyPropertyChanged接口实现Xaml

 1 <TreeView ItemsSource="{Binding Regions}"> 2  <TreeView.ItemContainerStyle> 3     <!--  4     This Style binds a TreeViewItem to a TreeViewItemViewModel.  5     --> 6     <Style TargetType="{x:Type TreeViewItem}"> 7       <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" /> 8       <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" /> 9       <Setter Property="FontWeight" Value="Normal" />10       <Style.Triggers>11         <Trigger Property="IsSelected" Value="True">12           <Setter Property="FontWeight" Value="Bold" />13         </Trigger>14       </Style.Triggers>15     </Style>16  </TreeView.ItemContainerStyle>17 18  <TreeView.Resources>19     <HierarchicalDataTemplate 20       DataType="{x:Type local:RegionViewModel}color: #0000f 

读书人网 >CAD教程

热点推荐