随笔分类 - WPF控件
摘要:英文原文地址:Simplifying the WPF TreeView by Using the ViewModel Pattern作者:Josh Smith文中代码的下载地址:http://www.codeproject.com/KB/WPF/TreeViewWithViewModel/TreeViewWithViewModelDemo.zip好像需要登录才能下载,我放一个上来吧http://files.cnblogs.com/RMay/TreeViewWithViewModelDemo.zip译者按:WPF中对TreeView的操作同WinForm中有很大的不同。这篇文章讲述了如何用Vie
阅读全文
摘要:Dictionary<string, CustomeType>中的CustomeType是一个集合,将其绑定生成一棵树,树的第一层节点是Dictionary的Key,第二层是CustomeType集合,所有代码用XAML实现。代码如下:<TreeViewName="dictree"ItemsSource="{Binding}"><TreeView.Resources><HierarchicalDataTemplateItemsSource="{BindingValue}"DataType=&q
阅读全文
摘要:XAML代码:<Window x:Class="WpfApplication3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid > &l
阅读全文
摘要:<Window.Resources> <!--定义按钮样式--> <Style TargetType="Button"> <Setter Property="Foreground" Value="Black"/> <!--修改模板属性--> <Setter Property="Template"> <Setter.Value> <!--控件模板--> <ControlTemplate TargetType=&quo
阅读全文


浙公网安备 33010602011771号