摘要:
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... 阅读全文
2012年10月29日
2011年10月21日
摘要:
ItemsPresenterpresenter = (ItemsPresenter)lb.Template.FindName("PART_Presenter", lb);Panelpanel = (Panel)VisualTreeHelper.GetChild(presenter, 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 阅读全文
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命名空间中。 阅读全文
2011年9月29日
摘要:
protected override bool IsItemItsOwnContainerOverride(object item) { return item is ListBoxItem; } protected override DependencyObject GetContainerForItemOverride() { return newListBoxItem(); } 阅读全文
摘要:
上岁数了,好多东西记不住了,找个地儿和大家一起备忘。 阅读全文