How to open second window from first window in wpf in C#?

This is how you would open a second window in WPF.


private void btnAppointmentPage_Click(object sender, RoutedEventArgs e)

{

//In this example we have already created a WPF Window and called
//it AppointmentsMain.xaml

AppointmentsMain AppointmentWindow = newAppointmentsMain();

AppointmentWindow.Show();

this.Close();

}