.Net-Avalonia学习笔记(十)-Material.Avalonia
-
Add Material.Avalonia nuget package to your project:
dotnet add package Material.Avalonia
-
Edit
App.xaml
file:<Application ... xmlns:themes="clr-namespace:Material.Styles.Themes;assembly=Material.Styles" ...> <Application.Styles> <themes:MaterialTheme BaseTheme="Dark" PrimaryColor="Purple" SecondaryColor="Lime" /> </Application.Styles> </Application>
-
Installing additional packages:
All styles will be included automatically if you using
MaterialTheme
-
If you want to use
DataGrid
control, add Material.Avalonia.DataGrid package:dotnet add package Material.Avalonia.DataGrid
-
If you want to use dialogs provided from Material.Avalonia, add Material.Avalonia.Dialogs package:
dotnet add package Material.Avalonia.Dialogs
-
-
Done! Now your app is styled! You can use the Demo app to view how different styles look.
Every control has the ShowMeTheXaml button in the right bottom corner which will show you a markup needed to recreate it.
本文来自博客园,作者:꧁执笔小白꧂,转载请注明原文链接:https://www.cnblogs.com/qq2806933146xiaobai/p/18562815