I'm creating a Templated Control in my Universal Windows Application.
The problem is that in the <Button Content="{Binding}" Command="{TemplateBinding AddCharCommand}" />
the TemplateBinding
doesn't work.
It seems that the problem is because it's defined inside a DataTemplate
.
This is the Style
and the template applied to my control.
<Style TargetType="local:CoordinatesControl">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:CoordinatesControl">
<ListView ItemsSource="{TemplateBinding Numbers}">
<ListView.ItemTemplate>
<DataTemplate>
<Button Content="{Binding}"
Command="{TemplateBinding AddCharCommand}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>