При переходах между окнами xaml затирается страница и становится чисто белой
<Window x:Class = "WPF_Project.HotelSearch"
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:WPF_Project"
mc:Ignorable = "d"
xmlns:materialDesign = "http://materialdesigninxaml.net/winfx/xaml/themes"
Title = "Hotel search" Height = "600" Width = "1000">
<Window.Resources>
<Storyboard x:Key="CloseMenu">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)"
Storyboard.TargetName="GridMenu">
<EasingDoubleKeyFrame KeyTime="0" Value="250"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="GridBackground">
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
<Storyboard x:Key="OpenMenu">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)"
Storyboard.TargetName="GridMenu">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="250"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="GridBackground">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</Window.Resources>
<Window.Triggers>
<EventTrigger RoutedEvent = "Loaded">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard TargetProperty = "Width" TargetName = "personalAccountButton">
<DoubleAnimation From = "0" To = "130"
AutoReverse = "True"
RepeatBehavior = "0:0:1.5"
Duration = "0:0:1.5">
</DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
<EventTrigger RoutedEvent="ButtonBase.Click" SourceName="ButtonClose">
<BeginStoryboard x:Name="CloseMenu_BeginStoryboard" Storyboard="{StaticResource CloseMenu}"/>
</EventTrigger>
<EventTrigger RoutedEvent="ButtonBase.Click" SourceName="ButtonOpen">
<BeginStoryboard Storyboard="{StaticResource OpenMenu}"/>
</EventTrigger>
</Window.Triggers>
<Grid Background = "#371f60">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="142*"/>
<ColumnDefinition Width="851*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="13*"/>
<RowDefinition Height="558*"/>
</Grid.RowDefinitions>
<Grid x:Name="GridBackground" Background = "#371f60" Margin="0,0,0.334,-0.333" Opacity="0" Grid.RowSpan="2" Grid.ColumnSpan="2"/>
<Border Height="400" Width ="700" MinHeight = "450" MaxHeight="600" MaxWidth = "700" MinWidth ="400" Margin = "0,45,0,59"
Background = "White" VerticalAlignment = "Center" Padding = "30" CornerRadius = "20" Grid.Row="1" Grid.ColumnSpan="2">
<Border.Effect>
<DropShadowEffect BlurRadius = "30" Color = "LightGray" ShadowDepth = "0"/>
</Border.Effect>
<StackPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width = "123*"/>
<ColumnDefinition Width = "367*"/>
</Grid.ColumnDefinitions>
<Button x:Name = "personalAccountButton" Content = "Personal account" FontWeight = "Bold"
Foreground = "White" Background = "#371f60" Margin = "353.333,-4,-4,-20"
FontSize = "11" VerticalAlignment = "Top" Grid.Column = "1" BorderBrush = "{x:Null}" Height = "40"
Click="personalAccountButton_Click">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border
BorderBrush = "{TemplateBinding BorderBrush}"
BorderThickness = "{TemplateBinding BorderThickness}"
Height = "{TemplateBinding Height}"
Width = "{TemplateBinding Width}">
<Border.Background>
<SolidColorBrush x:Name = "BorderColor" Color = "#371f60" />
</Border.Background>
<ContentControl Margin = "{TemplateBinding Padding}"
HorizontalAlignment = "{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment = "{TemplateBinding VerticalContentAlignment}"
Content = "{TemplateBinding Content}" />
<VisualStateManager.VisualStateGroups>
<VisualStateGroup Name = "CommonStates">
<VisualState Name = "MouseOver">
<Storyboard>
<ColorAnimation Storyboard.TargetName = "BorderColor"
Storyboard.TargetProperty = "Color" To = "#ff5e5b"/>
</Storyboard>
</VisualState>
<VisualState Name = "Normal">
<Storyboard>
<ColorAnimation Storyboard.TargetName ="BorderColor"
Storyboard.TargetProperty = "Color" To = "#371f60" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Border>
</ControlTemplate>
</Button.Template>
</Button>
</Grid>
</StackPanel>
</Border>
<Button x:Name="ButtonOpen" HorizontalAlignment="Left" VerticalAlignment="Top"
Background="{x:Null}" BorderBrush="{x:Null}" Width="50" Height="50" Padding="0" Grid.RowSpan="2">
<materialDesign:PackIcon Kind="Menu" Foreground="White" Height="25" Width="25"/>
</Button>
<Grid x:Name="GridMenu" Width="246" HorizontalAlignment="Left" Margin="-250,0,0,-0.333" Background="White"
RenderTransformOrigin="0.5,0.5" Grid.RowSpan="2">
<Grid.RenderTransform>
<TransformGroup>
<ScaleTransform/>
<SkewTransform/>
<RotateTransform/>
<TranslateTransform/>
</TransformGroup>
</Grid.RenderTransform>
<StackPanel>
<Image Height="181" Source="Resources/hotel.jpg" Stretch="Fill"/>
<ListView Foreground="#371f60" FontFamily="Champagne & Limousines" FontSize="18">
<ListViewItem Height="45" Padding="0" Selected="ListViewItem_Selected">
<StackPanel Orientation="Horizontal" Margin="10 0">
<materialDesign:PackIcon Kind="Language" Width="20" Height="20" Foreground="#371f60" Margin="5" VerticalAlignment="Center"/>
<TextBlock Text="Language" Margin="10"/>
</StackPanel>
</ListViewItem>
<ListViewItem Height="45" Padding="0">
<StackPanel Orientation="Horizontal" Margin="10 0">
<materialDesign:PackIcon Kind="HelpCircleOutline" Width="20" Height="20" Foreground="#371f60" Margin="5" VerticalAlignment="Center"/>
<TextBlock Text="Help" Margin="10"/>
</StackPanel>
</ListViewItem>
<ListViewItem Height="45" Padding="0">
<StackPanel Orientation="Horizontal" Margin="10 0">
<materialDesign:PackIcon Kind="Lightbulb" Width="20" Height="20" Foreground="#371f60" Margin="5" VerticalAlignment="Center"/>
<TextBlock Text="Send Feedback" Margin="10"/>
</StackPanel>
</ListViewItem>
<ListViewItem Height="45" Padding="0">
<StackPanel Orientation="Horizontal" Margin="10 0">
<materialDesign:PackIcon Kind="Heart" Width="20" Height="20" Foreground="#371f60" Margin="5" VerticalAlignment="Center"/>
<TextBlock Text="Recommend" Margin="10"/>
</StackPanel>
</ListViewItem>
<ListViewItem Height="45" Padding="0">
<StackPanel Orientation="Horizontal" Margin="10 0">
<materialDesign:PackIcon Kind="Settings" Width="20" Height="20" Foreground="#371f60" Margin="5" VerticalAlignment="Center"/>
<TextBlock Text="Settings" Margin="10"/>
</StackPanel>
</ListViewItem>
</ListView>
</StackPanel>
<Button x:Name="ButtonClose" HorizontalAlignment="Right" VerticalAlignment="Top" Background="{x:Null}"
BorderBrush="{x:Null}" Width="40" Height="40" Padding="0">
<materialDesign:PackIcon Kind="Close"/>
</Button>
</Grid>
</Grid>
</Window>
Кот страницы
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace WPF_Project
{
public partial class HotelSearch : Window
{
public HotelSearch()
{
//InitializeComponent();
}
private void personalAccountButton_Click(object sender, RoutedEventArgs e)
{
PersonalAccount personalAccount = new PersonalAccount();
personalAccount.Show();
Hide();
}
}
}
Переход на другую страницу После возвращения на эту страницу она становится белой

