希望这不是重复问题。
我希望能够在XAML中实现以下操作:
我希望能够在XAML中实现以下操作:
<DataTemplate DataType="{x:Type TestApp:ButtonVM}">
<Button
Grid.Column="{Binding GridColumn}"
Grid.Row="{Binding GridRow}"
Content="{Binding Path=Info}"
/>
</DataTemplate>
Content绑定可以正常工作,但Grid.Column和Grid.Row在生成的对象中根本不存在。即使我将它们设置为没有绑定的值(比如Grid.Column="1"),它们也不存在。我使用Snoop查看了应用程序,并发现在我的网格中没有人设置Grid.Column和Grid.Row。
有什么想法吗?