.Net-Avalonia学习笔记(十)-Material.Avalonia

 

  1. Add Material.Avalonia nuget package to your project:

    dotnet add package Material.Avalonia
  2. 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>
  3. 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
  4. 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.

posted @   ꧁执笔小白꧂  阅读(37)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· 一文读懂知识蒸馏
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
点击右上角即可分享
微信分享提示