如何在WPF中访问用户控件文本框的值
问题描述:
我在WPF应用程序中有两个用户控件.我想通过单击另一个用户控件中存在的按钮来更改文本框"控件的文本.
请帮帮我.
Hi,
I have two user controls in a WPF application. I want to change the "text of the Textbox control by clicking a button which is present in another user control.
Please help me out.
答
您可以将datagrid模板用作:
You can use datagrid template as:
<DataGridTemplateColumn Header="Command">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Button Name="cmdCommand" Click="{Binding Command}"
Content="Command"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn