mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-05 16:56:34 +08:00
feat: fix dark color. add theme switch in demo. add checkbox demo.
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Styling;
|
||||
using Semi.Avalonia.TreeDataGrid.Demo.ViewModels;
|
||||
|
||||
namespace Semi.Avalonia.TreeDataGrid.Demo;
|
||||
@@ -10,4 +13,14 @@ public partial class MainWindow : Window
|
||||
InitializeComponent();
|
||||
this.DataContext = new SongsPageViewModel();
|
||||
}
|
||||
|
||||
private void Button_OnClick(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
var app = Application.Current;
|
||||
if (app is not null)
|
||||
{
|
||||
var theme = app.ActualThemeVariant;
|
||||
app.RequestedThemeVariant = theme == ThemeVariant.Dark ? ThemeVariant.Light : ThemeVariant.Dark;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user