Revert all changes if window is closed by user.
This commit is contained in:
parent
733a091ebd
commit
f183b587b8
1 changed files with 10 additions and 0 deletions
|
|
@ -24,6 +24,16 @@ public partial class ThemePickerDialog : DialogWindow
|
|||
ThemeColors = new(EnumerateThemeItemColors(workingTheme, ActualThemeVariant));
|
||||
|
||||
DataContext = this;
|
||||
Closing += ThemePickerDialog_Closing;
|
||||
}
|
||||
|
||||
private void ThemePickerDialog_Closing(object? sender, Avalonia.Controls.WindowClosingEventArgs e)
|
||||
{
|
||||
if (!e.IsProgrammatic)
|
||||
{
|
||||
CancelAndClose();
|
||||
e.Cancel = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void CancelAndClose()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue