Okay, I have used your concept and put together a wire-frame sample for you.
Main Window Xaml:
<Window x:Class="WpfWindows.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfWindows"
mc:Ignorable="d" WindowStartupLocation="CenterScreen"
Title="MainWindow" Height="350" Width="525">
<Grid>
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<Button x:Name="Action1" Content="Action1"
Padding="10 5" Margin="5"
Click="Action_Click"/>
<Button x:Name="Action2" Content="Action2"
Padding="10 5" Margin="5"
Click="Action_Click"/>
</StackPanel>
</Grid>
</Window>
Main Window Code-Behind:
using System.Windows;
namespace WpfWindows
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Action_Click(object sender, RoutedEventArgs e)
{
Window window = null;
if (sender == Action1)
window = new Window1();
else
window = new Window2();
window.Owner = this;
window.Show();
}
}
}
Window1 Xaml:
<Window x:Class="WpfWindows.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfWindows"
mc:Ignorable="d" WindowStartupLocation="CenterOwner"
Title="Window1" Height="300" Width="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Viewbox>
<TextBlock Text="Window1"/>
</Viewbox>
<Button x:Name="Back" Grid.Row="1"
Padding="10 5" Margin="10"
HorizontalAlignment="Center"
Content="BACK"
Click="Back_Click"/>
</Grid>
</Window>
Window1 Code-Behind:
using System.Windows;
namespace WpfWindows
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
}
private void Back_Click(object sender, RoutedEventArgs e)
{
Close();
}
}
}
Window2 Xaml:
<Window x:Class="WpfWindows.Window2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfWindows"
mc:Ignorable="d" WindowStartupLocation="CenterOwner"
Title="Window2" Height="300" Width="300">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Viewbox>
<TextBlock Text="Window2"/>
</Viewbox>
<Button x:Name="Back" Grid.Row="1"
Padding="10 5" Margin="10"
HorizontalAlignment="Center"
Content="BACK"
Click="Back_Click"/>
</Grid>
</Window>
Window2 Code-Behind:
using System.Windows;
namespace WpfWindows
{
public partial class Window2 : Window
{
public Window2()
{
InitializeComponent();
}
private void Back_Click(object sender, RoutedEventArgs e)
{
Close();
}
}
}
As you will see, everything works as expected.
So what this is telling me is that there is a problem in your code in one of these windows,
BookingYourTicketsWindow
in this case.
Time to do some debugging... What I recommend is to comment out parts or all of your code to make sure the Window opens, closes, and reopens without errors. IF the issue is still there, then the problem is in your Xaml. PAir that back gradually until the error goes away, then you have identified the issue. Same goes for the code if the error is not in the Xaml, slowly re-introduce parts until the error re-appears.
Good Luck! :)