private void InitTab2(object sender, EventArgs e) { Page2 a = new Page2(); this.frmPage2.Content = a; a.ParentWindow = this; }
private void Button_Click_1(object sender, RoutedEventArgs e) { Page2 p2 = null; if (p2 == null) { p2 = new Page2(); } change.Content = new Frame() { Content = p2 }; }
private void btnNav_Click(object sender, RoutedEventArgs e) { Button btn = sender as Button; this.frmMain.Navigate(new Uri(btn.Tag.ToString() + ".xaml", UriKind.Relative)); switch (btn.Name) { case "btnA": Page1 page1 = new Page1(); this.frmMain.Content = page1; page1.ParentWindow = this; break; case "btnB": Page2 page2 = new Page2(); this.frmMain.Content = page2; page2.ParentWindow = this; break; } }