I love WPF

"jamais sans son interface"

I love WPF

"jamais sans son interface"

Day: 17 janvier 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 <Window.Resources> <DataTemplate DataType= »{x:Type local:ColorX} »> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width= »Auto » SharedSizeGroup= »ColumnSize » /> </Grid.ColumnDefinitions> <StackPanel Orientation= »Horizontal » Margin= »2″> <Rectangle Width= »40″ Height= »25″ Fill= »{Binding Brush} » Stroke= »Black » /> <TextBox Text= »{Binding Name} » IsReadOnly= »true » Background= »Transparent » VerticalAlignment= »Center » BorderThickness= »0″ Margin= »4 0 4 […]

Retour en haut