摘要:
treeview获取内部控件元素 Button btnAdd = ((tvks.HeaderTemplate as DataTemplate).LoadContent() as StackPanel).Children[2] as Button; listbox获取子元素控件(针对数据绑定) Lis
阅读全文
posted @ 2013-07-16 16:45
褚海达
阅读(346)
推荐(0)
编辑
摘要:
App.config: 后台代码获取:ConfigurationManager.AppSettings["ServicePath"].ToString().Trim();
阅读全文
posted @ 2013-07-16 16:44
褚海达
阅读(385)
推荐(0)
编辑
摘要:
作为例子,我决定定义一个MyBorderEx,在WPF常用的"Border"控件中创建一个名为Transparency的属性,来指示它的透明度,这个属性值在0-255间变化,255表示全透明,0表示完全不透明。DependecyProperty提供了属性改变通知的功能,我们可以利用DependencyProperty的这个功能,定义一个transparencyPropertyChangedCallback函数,在属性值变化(注意,这里指DependencyProperty的值发生变化而不是我们定义的"CLR wapper"的Transparency属性)
阅读全文
posted @ 2013-07-16 16:43
褚海达
阅读(563)
推荐(0)
编辑
摘要:
public void loadCheckListDataTemplate(TreeViewItem tvi) { DataTemplate cdt = new DataTemplate(); FrameworkElementFactory cfef = new FrameworkElementFactory(typeof(StackPanel)); cfef.SetValue(StackPanel.OrientationProperty, Orientation.Horizontal); Binding binding = new Binding(); FrameworkElementFac
阅读全文
posted @ 2013-07-16 16:42
褚海达
阅读(932)
推荐(0)
编辑
摘要:
模版样式为: 使用datatemplate的TreeViewItem,根据内部的Button获取tviTreeViewItem tvi = ((ContentPresenter)(((StackPanel)((Button)sender).Parent).TemplatedParent)).TemplatedParent as TreeViewItem;
阅读全文
posted @ 2013-07-16 16:41
褚海达
阅读(146)
推荐(0)
编辑
摘要:
private void WTNR_GRID_jbzl_AutoCompleteBox_Loaded(object sender, System.Windows.RoutedEventArgs e) { List cs = new List(); cs.Add(new JBJS { Name = "广州", ShortName = "GZ" }); cs.Add(new JBJS { Name = "南京", ShortName = "NJ" }); cs.Add(new JBJS { Name = "上
阅读全文
posted @ 2013-07-16 16:39
褚海达
阅读(6785)
推荐(0)
编辑
摘要:
IsChecked="{Binding IsSelected, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
阅读全文
posted @ 2013-07-16 16:38
褚海达
阅读(236)
推荐(0)
编辑
摘要:
对一些无法响应的时间,需要注册控件名:XZWT_TreeViewItem事件:this.XZWT_TreeViewItem_MouseLeftButtonDown具体注册方法:XZWT_TreeViewItem.AddHandler( TreeView.MouseLeftButtonDownEvent, new MouseButtonEventHandler(this.XZWT_TreeViewItem_MouseLeftButtonDown), true);
阅读全文
posted @ 2013-07-16 16:37
褚海达
阅读(197)
推荐(0)
编辑