Revert all changes if window is closed by user.
This commit is contained in:
parent
733a091ebd
commit
f183b587b8
@ -24,6 +24,16 @@ public partial class ThemePickerDialog : DialogWindow
|
|||||||
ThemeColors = new(EnumerateThemeItemColors(workingTheme, ActualThemeVariant));
|
ThemeColors = new(EnumerateThemeItemColors(workingTheme, ActualThemeVariant));
|
||||||
|
|
||||||
DataContext = this;
|
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()
|
protected override void CancelAndClose()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user