我已经尝试在网络上搜索使用 Windows Phone 中的命令,但我找不到适合我的问题的方案。我有一个DataTemplate
创建一些网格的。Click
对于这些网格,我希望他们在他们的事件被触发时做一些事情。但是,该Grid
元素没有Command
属性。
我不一定需要通过命令来做到这一点,但我认为这是要走的路。
这就是我想要做的。
<ItemsControl VerticalAlignment="Top" Visibility="Collapsed" x:Name="RadioList">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid Margin="12" Tag="{Binding}">
<!-- this is the grid I want to listen for clicks on -->
</Grid>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>