2012年10月29日

摘要: public T GetConfig<T>(string sectionName) where T : ConfigurationSection{ try { Assembly assembly = typeof(T).Assembly; string directory = Path.GetDirectoryName(assembly.CodeBase); string filename = Path.GetFileName(assembly.CodeBase); string assemblyPath = Path.Combine(directory, file... 阅读全文
posted @ 2012-10-29 10:54 beastplus 阅读(208) 评论(0) 推荐(0) 编辑

2011年10月21日

摘要: ItemsPresenterpresenter = (ItemsPresenter)lb.Template.FindName("PART_Presenter", lb);Panelpanel = (Panel)VisualTreeHelper.GetChild(presenter, 0); 阅读全文
posted @ 2011-10-21 09:26 beastplus 阅读(260) 评论(0) 推荐(0) 编辑

2011年10月20日

摘要: <ListBox ItemsSource="{Binding}" AlternationCount="{Binding Path=Count}"> <ListBox.ItemTemplate> <DataTemplate> <TextBlock Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}, Path=(ItemsControl.AlternationIndex)}&q 阅读全文
posted @ 2011-10-20 13:40 beastplus 阅读(699) 评论(0) 推荐(0) 编辑

2011年10月12日

摘要: [assembly: System.Windows.Markup.XmlnsDefinition("http://schemas.microsoft.com/winfx/2006/xaml/presentation", "MyControls")]这段语句的意思就是将MyControls命名空间映射到http://schemas.microsoft.com/winfx/2006/xaml/presentation命名空间中。 阅读全文
posted @ 2011-10-12 17:04 beastplus 阅读(208) 评论(0) 推荐(0) 编辑

2011年9月29日

摘要: protected override bool IsItemItsOwnContainerOverride(object item) { return item is ListBoxItem; } protected override DependencyObject GetContainerForItemOverride() { return newListBoxItem(); } 阅读全文
posted @ 2011-09-29 16:36 beastplus 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 上岁数了,好多东西记不住了,找个地儿和大家一起备忘。 阅读全文
posted @ 2011-09-29 16:27 beastplus 阅读(104) 评论(0) 推荐(0) 编辑

导航