Dereference current view on close.
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:osrs_toolbox"
|
xmlns:local="clr-namespace:osrs_toolbox"
|
||||||
mc:Ignorable="d"
|
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>
|
<Window.DataContext>
|
||||||
<local:CompetitionOverlayViewModel/>
|
<local:CompetitionOverlayViewModel/>
|
||||||
</Window.DataContext>
|
</Window.DataContext>
|
||||||
|
@@ -39,5 +39,10 @@ namespace osrs_toolbox
|
|||||||
var hwnd = new WindowInteropHelper(this).Handle;
|
var hwnd = new WindowInteropHelper(this).Handle;
|
||||||
WindowsServices.SetWindowExTransparent(hwnd);
|
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:osrs_toolbox"
|
xmlns:local="clr-namespace:osrs_toolbox"
|
||||||
mc:Ignorable="d"
|
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>
|
<Window.DataContext>
|
||||||
<local:DropChanceViewModel/>
|
<local:DropChanceViewModel/>
|
||||||
</Window.DataContext>
|
</Window.DataContext>
|
||||||
|
@@ -25,5 +25,10 @@ namespace osrs_toolbox
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Current = this;
|
Current = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Window_Closed(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Current = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -55,6 +55,7 @@ namespace osrs_toolbox
|
|||||||
Application.Current.MainWindow = HomePageView.Current;
|
Application.Current.MainWindow = HomePageView.Current;
|
||||||
HomePageView.Current.Show();
|
HomePageView.Current.Show();
|
||||||
this.Close();
|
this.Close();
|
||||||
|
Current = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
Reference in New Issue
Block a user