Avalonia版本11.0.0


添加System.Configuration.ConfigurationManager

- using Avalonia.Controls;
- using System.Configuration;
-
- namespace AvaloniaApplication7.Views
- {
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- // 读取配置项
- var DBOption = ConfigurationManager.AppSettings["DBOption"];
- }
- }
- }

- <Styles xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
- <Design.PreviewWith>
- </Design.PreviewWith>
- <Style Selector="TextBlock">
- <Setter Property="Foreground" Value="White" />
- <Setter Property="FontSize" Value="16" />
- <Setter Property="FontWeight" Value="Normal"/>
- </Style>
- </Styles>
打开App.axaml文件,添加
- <Application.Styles>
- <FluentTheme />
- <StyleInclude Source="/Assets/Styles/CommonStyles.axaml"/>
- </Application.Styles>

- <ResourceDictionary xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
- <SolidColorBrush x:Key="WindowDefaultBackground">#336699</SolidColorBrush>
- <!--Disabled颜色-->
- <Color x:Key="DisabledColor">#545454</Color>
- <Brush x:Key="EditWordColor">#FFFFFA</Brush>
- <Brush x:Key="ComboBoxBackground">#003366</Brush>
- <Brush x:Key="ComboBoxPopupBackground">#003366</Brush>
-
- <SolidColorBrush x:Key="GridColor1">#003e62</SolidColorBrush>
- <!--表头背景色-->
- <SolidColorBrush x:Key="ColumnHeaderBackground">#666699</SolidColorBrush>
- <!--行背景色-->
- <SolidColorBrush x:Key="RowBackground">#111B59</SolidColorBrush>
- <!--Grid背景色-->
- <Brush x:Key="GridBackground">#06173E</Brush>
- <!--Grid背景色-->
- <Brush x:Key="GridBackground1">#111B59</Brush>
- <SolidColorBrush x:Key="SystemControlBackgroundAltHighBrush">#1f497d</SolidColorBrush>
- <!--Memu的下级Popup背景色-->
- <SolidColorBrush x:Key="MenuFlyoutBackground">#052350</SolidColorBrush>
- <!--默认字体-->
- <FontFamily x:Key="DefaultFontFamily">Microsoft YaHei</FontFamily>
- </ResourceDictionary>
打开App.axaml文件,添加
- <Application.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <MergeResourceInclude Source="/Assets/CommonResource.axaml" />
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </Application.Resources>
- <Style Selector="TextBox">
- <Setter Property="Margin" Value="0 -10 0 10" />
- <Setter Property="FontFamily" Value="{StaticResource DefaultFontFamily}" />
- </Style>
打开App.axaml.cs文件
