Archive

Archives pour 01/2019

Synchronize items Width in WrapPanel

if you want to have the same width size for each items in WrapPanel (in in ListBox for sample)
you can use Grid.IsSharedSizeScope= »True » like this

 

Categories: Non classé Tags:

FallbackValue for Command

When you try to connect an MVVM command, it must be better to have a fallbackvalue if binding not release
a null static command return false is the solution for showed that the binding cannot be set (and not allow command)

for sample if i have the command : CloseCommand in Selected in my MVVM
when selected is set to null the binding not released
the fallbackvalue is set in this case

I use a static command

and i use like this

 

Categories: Non classé Tags:

Alternative for ICollectionView (for sorting update)

When you want to sort a collection in MVVM you use

but if you want to update sorting in treeview for sample you can use

and set IsLiveSorting to true

for sample see converter using in TreeView for update sorting hierarchical

and using

 

Categories: Non classé Tags: , , ,