I want to close a window in WPF after clicking a button that sends me to another window.
I tried with win3.Close();
but it doesn't work.
This is the Main Window that references to the second window.
private void Button_Click_1(object sender, RoutedEventArgs e)
{
Window2 win3 = new Window2();
win3.Show();
}
Or it should be hidden?