Sup*_*JMN 5 .net xaml uwp windows-10-universal
我正在创建一个模板控件我的通用 Windows 应用程序中。
问题是,在<Button Content="{Binding}" Command="{TemplateBinding AddCharCommand}" />该TemplateBinding不起作用。
似乎问题是因为它是在一个 DataTemplate.
这是Style应用到我的控件的模板。
<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>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
359 次 |
| 最近记录: |