1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
| namespace WpfDeuxForms
{
/// <summary>
/// Logique d'interaction pour MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void btnFille1_Click(object sender, RoutedEventArgs e)
{
WinFille1 doc = new WinFille1();
doc.Owner = this;
doc.Closing += new System.ComponentModel.CancelEventHandler(doc_Closing); doc.Show();
((App)Application.Current).Documents.Add(doc);
((App)Application.Current).MainWindow.Hide();
}
private void btnFille2_Click(object sender, RoutedEventArgs e)
{
WinFille2 doc = new WinFille2();
doc.Owner = this;
doc.Closing += new System.ComponentModel.CancelEventHandler(doc_Closing);
doc.Show();
((App)Application.Current).Documents.Add(doc);
((App)Application.Current).MainWindow.Hide();
}
private void btnFille3_Click(object sender, RoutedEventArgs e)
{
WinFille3 doc = new WinFille3();
doc.Owner = this;
doc.Closing += new System.ComponentModel.CancelEventHandler(doc_Closing); doc.Show();
((App)Application.Current).Documents.Add(doc);
((App)Application.Current).MainWindow.Hide();
}
void doc_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
this.Show();
}
}
} |