Skip to content

Commit

Permalink
Fixed onClose
Browse files Browse the repository at this point in the history
  • Loading branch information
flabbet committed Mar 11, 2021
1 parent 1df296f commit cd71c96
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion PixiEditor/ViewModels/ViewModelMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private Shortcut CreateToolShortcut<T>(Key key, ModifierKeys modifier = Modifier
return new Shortcut(key, ToolsSubViewModel.SelectToolCommand, typeof(T), modifier);
}

private void CloseWindow(object property)
public void CloseWindow(object property)
{
if (!(property is CancelEventArgs))
{
Expand Down
2 changes: 1 addition & 1 deletion PixiEditor/Views/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
xmlns:cmd="http://www.galasoft.ch/mvvmlight"
xmlns:avalondock="https://github.com/Dirkster99/AvalonDock"
xmlns:colorpicker="clr-namespace:ColorPicker;assembly=ColorPicker" xmlns:usercontrols="clr-namespace:PixiEditor.Views.UserControls" xmlns:behaviours="clr-namespace:PixiEditor.Helpers.Behaviours"
xmlns:avalonDockTheme="clr-namespace:PixiEditor.Styles.AvalonDock"
xmlns:avalonDockTheme="clr-namespace:PixiEditor.Styles.AvalonDock" d:DataContext="{d:DesignInstance Type=vm:ViewModelMain}"
mc:Ignorable="d" WindowStyle="None" Initialized="MainWindow_Initialized"
Title="PixiEditor" Name="mainWindow" Height="1000" Width="1600" Background="{StaticResource MainColor}"
WindowStartupLocation="CenterScreen" WindowState="Maximized">
Expand Down
1 change: 1 addition & 0 deletions PixiEditor/Views/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public MainWindow()

protected override void OnClosing(CancelEventArgs e)
{
((ViewModelMain)DataContext).CloseWindow(e);
viewModel.DiscordViewModel.Dispose();
}

Expand Down

0 comments on commit cd71c96

Please sign in to comment.