i have a listbox who takes values from Dictionary Size:
this is the Size type:
public Dictionary<string, int> Size
{
get;
private set;
}
this is my listbox
<ListBox x:Name="boardSize" ItemsSource="{Binding Size}" ItemTemplate="{DynamicResource DataTemplate1}" />
this is my the associated DataTemplate:
<Rectangle Margin="8,8,16,8" Stroke="Black" RadiusX="45" RadiusY="45">
<Rectangle.Fill>
<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="Black" Offset="0"/>
<GradientStop Color="#FFE24A4A" Offset="1"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
<TextBlock x:Name="textBlock" **Text="{Binding path=Size}"**/>
I have two problems:
- where I putted ** I want the textblock text to contain the Size key value
- how can I do command pattern when a button is pushed ?