//window窗体的代码
public partial class win_Main : Window
{
/// <summary>
/// 子页Page调用本窗体的方法
/// </summary>
/// <Author> frd 2011-9-20 16:37</Author>
public void CallFromChild()
{
MessageBox.Show("this is call from child page!");
}
/// <summary>
/// 打开Page事件
/// </summary>
/// <Author> frd 2011-9-20 16:37</Author>
private void img_SeatConfig_MouseUp(object sender, MouseButtonEventArgs e)
{
pag_SeatConfig pag_seatconfig = new pag_SeatConfig(EachCount);
pag_seatconfig.ParentWindow = this;
this.frame_Main.Content = pag_seatconfig;
}
}
//Page页的代码
/// <summary>
/// 子页Page
/// </summary>
/// <Author> frd 2011-9-20 16:37</Author>
public partial class pag_SeatConfig : Page
{
win_Main parentWindow;
public win_Main ParentWindow
{
get { return parentWindow; }
set { parentWindow = value; }
}
private void image_Commit_MouseUp(object sender, MouseButtonEventArgs e)
{
parentWindow.CallFromChild();
}
}