Difference between ObservableCollection and BindingList

I want to know the difference between ObservableCollection and BindingList because I’ve used both to notify for any add/delete change in Source, but I actually do not know when to prefer one over the other. Why would I choose one of the following over the other? ObservableCollection<Employee> lstEmp = new ObservableCollection<Employee>(); or BindingList<Employee> lstEmp = … Read more

Data binding to SelectedItem in a WPF Treeview

How can I retrieve the item that is selected in a WPF-treeview? I want to do this in XAML, because I want to bind it. You might think that it is SelectedItem but apparently that does not exist is readonly and therefore unusable. This is what I want to do: <TreeView ItemsSource=”{Binding Path=Model.Clusters}” ItemTemplate=”{StaticResource ClusterTemplate}” … Read more

ResourceDictionary in a separate assembly

I have resource dictionary files (MenuTemplate.xaml, ButtonTemplate.xaml, etc) that I want to use in multiple separate applications. I could add them to the applications’ assemblies, but it’s better if I compile these resources in one single assembly and have my applications reference it, right? After the resource assembly is built, how can I reference it … Read more