Dereference current view on close.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:osrs_toolbox"
|
||||
mc:Ignorable="d"
|
||||
Title="Competition Info" Height="800" Width="500" AllowsTransparency="True" Background="Transparent" WindowStyle="None" ResizeMode="NoResize" SizeToContent="WidthAndHeight" MouseDown="Window_MouseDown" Topmost="True">
|
||||
Title="Competition Info" Height="800" Width="500" AllowsTransparency="True" Background="Transparent" WindowStyle="None" ResizeMode="NoResize" SizeToContent="WidthAndHeight" MouseDown="Window_MouseDown" Topmost="True" Closed="Window_Closed">
|
||||
<Window.DataContext>
|
||||
<local:CompetitionOverlayViewModel/>
|
||||
</Window.DataContext>
|
||||
|
@@ -39,5 +39,10 @@ namespace osrs_toolbox
|
||||
var hwnd = new WindowInteropHelper(this).Handle;
|
||||
WindowsServices.SetWindowExTransparent(hwnd);
|
||||
}
|
||||
|
||||
private void Window_Closed(object sender, EventArgs e)
|
||||
{
|
||||
Current = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:osrs_toolbox"
|
||||
mc:Ignorable="d"
|
||||
Title="Drop Chance Calculator" Height="450" Width="800" SizeToContent="WidthAndHeight">
|
||||
Title="Drop Chance Calculator" Height="450" Width="800" SizeToContent="WidthAndHeight" Closed="Window_Closed">
|
||||
<Window.DataContext>
|
||||
<local:DropChanceViewModel/>
|
||||
</Window.DataContext>
|
||||
|
@@ -25,5 +25,10 @@ namespace osrs_toolbox
|
||||
InitializeComponent();
|
||||
Current = this;
|
||||
}
|
||||
|
||||
private void Window_Closed(object sender, EventArgs e)
|
||||
{
|
||||
Current = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -55,6 +55,7 @@ namespace osrs_toolbox
|
||||
Application.Current.MainWindow = HomePageView.Current;
|
||||
HomePageView.Current.Show();
|
||||
this.Close();
|
||||
Current = null;
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
|
Reference in New Issue
Block a user