diff --git a/App.axaml b/App.axaml index f1e306f..6e26636 100644 --- a/App.axaml +++ b/App.axaml @@ -1,14 +1,11 @@ + RequestedThemeVariant="Light"> - - - - - 10 - 1000 - + + + + \ No newline at end of file diff --git a/App.axaml.cs b/App.axaml.cs index 613c6f1..7c0efdf 100644 --- a/App.axaml.cs +++ b/App.axaml.cs @@ -1,6 +1,8 @@ using Avalonia; +using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Markup.Xaml; +using Avalonia.Styling; namespace PLG_Exam; @@ -11,6 +13,13 @@ public partial class App : Application AvaloniaXamlLoader.Load(this); } + public void ToggleTheme() + { + RequestedThemeVariant = RequestedThemeVariant == ThemeVariant.Dark + ? ThemeVariant.Light + : ThemeVariant.Dark; + } + public override void OnFrameworkInitializationCompleted() { if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) diff --git a/MainWindow.axaml b/MainWindow.axaml index 9a88d35..d21106b 100644 --- a/MainWindow.axaml +++ b/MainWindow.axaml @@ -7,9 +7,9 @@ Title="PLG Exam"> - + - +