there is 3 WPF window, main window goes to second by clicking an item and second window goes to third window by clicking an item. use this code to travel from second window to third window:
thirdwindow obj= new thirdwindow();
obj.Show();
this.Close();
in XAML code, closed event is set for second window and call a method with inner code:
Application.Current.Shutdown();
so when press X button application stop running. but this will make program stop running when third window is called and second window get close. how can i separate closing second window by X button to terminate app from closing second window for call third window and not want to stop app from running