I love WPF

"jamais sans son interface"

I love WPF

"jamais sans son interface"

Converter

Binding for non hierarchical object

If you have an object who is not in herarchical tree, like converter, you cannot bind something even you have define DependyProperty on it. first you must prepare you converter for having DependencyProperty by override DependencyObject public class SelectionConverter : DependencyObject, IMultiValueConverter then create DependencyProperties #region Window (DP SHORT) public object Window { get { […]

Alternative for ICollectionView (for sorting update)

When you want to sort a collection in MVVM you use ICollectionView view = CollectionViewSource.GetDefaultView(Items); view.SortDescriptions.Clear(); view.SortDescriptions.Add(new SortDescription(« DirtyName », ListSortDirection.Descending)); but if you want to update sorting in treeview for sample you can use ListCollectionView view = new ListCollectionView(collection); view.IsLiveSorting = true; SortDescription sort = new SortDescription(« DirtyName », ListSortDirection.Ascending); view.SortDescriptions.Add(sort); and set IsLiveSorting to true for sample […]

Retour en haut