【发布时间】:2011-05-24 17:21:59
【问题描述】:
我创建了 WPF 浏览器应用程序并添加了页面和窗口。单击页面中的按钮时,它会打开带有 DataGrid 中详细信息列表的窗口。我想将 Window 的 DataGrid 中的值分配给 Page Controls。
在Window code behind (Window1.xaml.cs)中使用以下代码将值不分配给Page控件
private void DataGrid1_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
Page1 page = new Page1();
page.txtName.Text = "GridValue1";
this.Close();
}
当我双击时,来自 Wiindow1 Datagrid 的值应该分配给 Page1 的控件。我没有获得正确的页面对象来为 txtName.text 分配 Window1 的 DataGrid 值。
非常感谢提前...
【问题讨论】:
标签: wpf