silverlight Datagrid事件触发器 [英] silverlight Datagrid event triggers
本文介绍了silverlight Datagrid事件触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我在SL4 datagrid中面临一个难题.
我单击按钮时在网格内部使用一个按钮和textblok,这是我从子窗口中选择子窗口,选择值绑定到texblock的值,如何做到这一点,请帮助任何人.
问候,
Narasimha
Hi All,
I have facing one prolem in SL4 datagrid.
i am using inside grid one button and textblok when i clicked the button i am opning the childwindow from child window selecting value that value binding to texblock how can do this please help on this anybody.
Regards,
Narasimha
推荐答案
您可以使用以下代码,将按钮作为MyButton文本块考虑为MyTextBlock:
You can use the below code considering button as MyButton textblock as MyTextBlock:
private void MyButton_Click(object sender, RoutedEventArgs e)
{
ShowMyChild();
}
private void ShowMyChild()
{
AutoResetEvent waitHandle = new AutoResetEvent(false);
Dispatcher.BeginInvoke(() =>
{
ChildWindow cw = new ChildWindow();
cw.Content = this.MyTextBlock.Text;
cw.Closed += (s, e) => waitHandle.Set();
cw.Show();
});
waitHandle.WaitOne();
}
这篇关于silverlight Datagrid事件触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文