feat: initialize Avalonia demo.

This commit is contained in:
NaBian committed 2023-12-10 16:41:03 +08:00
1 parent babf40e59f
commit 646c4b0e01
31 files changed
+687 -19

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<Nullable>enable</Nullable>
<AvaloniaVersion>11.0.6</AvaloniaVersion>
</PropertyGroup>
</Project>
@@ -0,0 +1,11 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="HandyControlDemo.App"
RequestedThemeVariant="Default">
<Application.Styles>
<StyleInclude Source="avares://HandyControl/Themes/Theme.axaml"/>
<StyleInclude Source="avares://HandyControlDemo/Resources/Themes/Theme.axaml"/>
<!--<FluentTheme />-->
<!--<hc:Theme/>-->
</Application.Styles>
</Application>
@@ -0,0 +1,28 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Data.Core.Plugins;
using Avalonia.Markup.Xaml;
namespace HandyControlDemo;
// ReSharper disable once PartialTypeWithSinglePart
public partial class App : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}
public override void OnFrameworkInitializationCompleted()
{
BindingPlugins.DataValidators.RemoveAt(0);
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow = new MainWindow();
}
base.OnFrameworkInitializationCompleted();
}
}
@@ -0,0 +1,41 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<!--If you are willing to use Windows/MacOS native APIs you will need to create 3 projects.
One for Windows with net7.0-windows TFM, one for MacOS with net7.0-macos and one with net7.0 TFM for Linux.-->
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<ApplicationManifest>app.manifest</ApplicationManifest>
<AssemblyName>HandyControlDemo</AssemblyName>
<RootNamespace>HandyControlDemo</RootNamespace>
</PropertyGroup>
<ItemGroup>
<None Remove="Resources\Img\cloud.png" />
<None Remove="Resources\Img\icon.ico" />
</ItemGroup>
<ItemGroup>
<AvaloniaResource Include="Resources\Img\icon.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\HandyControl_Avalonia\HandyControl_Avalonia.csproj" />
</ItemGroup>
<ItemGroup>
<AvaloniaResource Include="Resources\Img\cloud.png" />
</ItemGroup>
<ItemGroup>
<Compile Update="App.axaml.cs">
<DependentUpon>App.axaml</DependentUpon>
</Compile>
<Compile Update="Views\Styles\ButtonDemoCtrl.axaml.cs">
<DependentUpon>ButtonDemoCtrl.axaml</DependentUpon>
</Compile>
</ItemGroup>
</Project>
@@ -0,0 +1,15 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:views="clr-namespace:HandyControlDemo.Views"
mc:Ignorable="d"
d:DesignWidth="800"
d:DesignHeight="450"
Background="{DynamicResource SecondaryRegionBrush}"
Icon="/Resources/Img/icon.ico"
x:Class="HandyControlDemo.MainWindow"
WindowStartupLocation="CenterScreen"
Title="HandyControlDemo">
<views:MainWindowContent/>
</Window>
@@ -0,0 +1,11 @@
using Avalonia.Controls;
namespace HandyControlDemo;
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
@@ -0,0 +1,16 @@
using System;
using Avalonia;
namespace HandyControlDemo;
public class Program
{
[STAThread]
public static void Main(string[] args) => BuildAvaloniaApp()
.StartWithClassicDesktopLifetime(args);
public static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.LogToTrace();
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

@@ -0,0 +1,6 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<MergeResourceInclude Source="Brushes.axaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
@@ -0,0 +1,8 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<DrawingBrush x:Key="CloudDrawingBrush" Stretch="Uniform" TileMode="Tile" SourceRect="0 0 157 157" DestinationRect="0 0 157 157" Opacity=".1">
<DrawingBrush.Drawing>
<ImageDrawing ImageSource="avares://HandyControlDemo/Resources/Img/cloud.png" Rect="0 0 157 157"/>
</DrawingBrush.Drawing>
</DrawingBrush>
</ResourceDictionary>
@@ -0,0 +1,10 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Styles.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<MergeResourceInclude Source="Basic/Basic.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Styles.Resources>
</Styles>
@@ -0,0 +1,22 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:views="clr-namespace:HandyControlDemo.Views"
mc:Ignorable="d"
d:DesignWidth="800"
d:DesignHeight="450"
Background="{StaticResource CloudDrawingBrush}"
x:Class="HandyControlDemo.Views.MainWindowContent">
<Grid MinHeight="300" MinWidth="200" HorizontalAlignment="Center" VerticalAlignment="Center">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Grid.RowSpan="2" CornerRadius="10" Background="{DynamicResource RegionBrush}" Effect="{StaticResource EffectShadow4}"/>
<Border Grid.Row="0" Height="32" CornerRadius="10 10 0 0" Background="{DynamicResource TitleBrush}">
<TextBlock Text="Button" Foreground="{DynamicResource TextIconBrush}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<views:ButtonDemoCtrl Grid.Row="1"/>
</Grid>
</UserControl>
@@ -0,0 +1,11 @@
using Avalonia.Controls;
namespace HandyControlDemo.Views;
public partial class MainWindowContent : UserControl
{
public MainWindowContent()
{
InitializeComponent();
}
}
@@ -0,0 +1,17 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignWidth="800"
d:DesignHeight="450"
x:Class="HandyControlDemo.Views.ButtonDemoCtrl">
<StackPanel Orientation="Horizontal" VerticalAlignment="Top" Spacing="4" Margin="32">
<Button Content="default" />
<Button Content="primary" Classes="primary"/>
<Button Content="success" Classes="success"/>
<Button Content="info" Classes="info"/>
<Button Content="warning" Classes="warning"/>
<Button Content="danger" Classes="danger"/>
</StackPanel>
</UserControl>
@@ -0,0 +1,11 @@
using Avalonia.Controls;
namespace HandyControlDemo.Views;
public partial class ButtonDemoCtrl : UserControl
{
public ButtonDemoCtrl()
{
InitializeComponent();
}
}
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="HandyControlDemo"/>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
</assembly>
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<AssemblyName>HandyControl</AssemblyName>
<RootNamespace>HandyControl</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
</ItemGroup>
</Project>
@@ -0,0 +1,4 @@
using Avalonia.Metadata;
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Themes")]
[assembly: XmlnsPrefix("https://handyorg.github.io/handycontrol", "hc")]
@@ -0,0 +1,64 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="LightPrimaryBrush" Color="{DynamicResource LightPrimaryColor}"/>
<LinearGradientBrush x:Key="PrimaryBrush" EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="{DynamicResource PrimaryColor}" Offset="0"/>
<GradientStop Color="{DynamicResource DarkPrimaryColor}" Offset="1"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="DarkPrimaryBrush" Color="{DynamicResource DarkPrimaryColor}"/>
<SolidColorBrush x:Key="PrimaryTextBrush" Color="{DynamicResource PrimaryTextColor}"/>
<SolidColorBrush x:Key="SecondaryTextBrush" Color="{DynamicResource SecondaryTextColor}"/>
<SolidColorBrush x:Key="ThirdlyTextBrush" Color="{DynamicResource ThirdlyTextColor}"/>
<SolidColorBrush x:Key="ReverseTextBrush" Color="{DynamicResource ReverseTextColor}"/>
<SolidColorBrush x:Key="TextIconBrush" Color="{DynamicResource TextIconColor}"/>
<SolidColorBrush x:Key="BorderBrush" Color="{DynamicResource BorderColor}"/>
<SolidColorBrush x:Key="SecondaryBorderBrush" Color="{DynamicResource SecondaryBorderColor}"/>
<SolidColorBrush x:Key="BackgroundBrush" Color="{DynamicResource BackgroundColor}"/>
<SolidColorBrush x:Key="RegionBrush" Color="{DynamicResource RegionColor}"/>
<SolidColorBrush x:Key="SecondaryRegionBrush" Color="{DynamicResource SecondaryRegionColor}"/>
<SolidColorBrush x:Key="ThirdlyRegionBrush" Color="{DynamicResource ThirdlyRegionColor}"/>
<LinearGradientBrush x:Key="TitleBrush" EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="{DynamicResource TitleColor}" Offset="0"/>
<GradientStop Color="{DynamicResource SecondaryTitleColor}" Offset="1"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="DefaultBrush" Color="{DynamicResource DefaultColor}"/>
<SolidColorBrush x:Key="DarkDefaultBrush" Color="{DynamicResource DarkDefaultColor}"/>
<SolidColorBrush x:Key="LightDangerBrush" Color="{DynamicResource LightDangerColor}"/>
<LinearGradientBrush x:Key="DangerBrush" EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="{DynamicResource DangerColor}" Offset="0"/>
<GradientStop Color="{DynamicResource DarkDangerColor}" Offset="1"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="DarkDangerBrush" Color="{DynamicResource DarkDangerColor}"/>
<SolidColorBrush x:Key="LightWarningBrush" Color="{DynamicResource LightWarningColor}"/>
<LinearGradientBrush x:Key="WarningBrush" EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="{DynamicResource WarningColor}" Offset="0"/>
<GradientStop Color="{DynamicResource DarkWarningColor}" Offset="1"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="DarkWarningBrush" Color="{DynamicResource DarkWarningColor}"/>
<SolidColorBrush x:Key="LightInfoBrush" Color="{DynamicResource LightInfoColor}"/>
<LinearGradientBrush x:Key="InfoBrush" EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="{DynamicResource InfoColor}" Offset="0"/>
<GradientStop Color="{DynamicResource DarkInfoColor}" Offset="1"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="DarkInfoBrush" Color="{DynamicResource DarkInfoColor}"/>
<SolidColorBrush x:Key="LightSuccessBrush" Color="{DynamicResource LightSuccessColor}"/>
<LinearGradientBrush x:Key="SuccessBrush" EndPoint="1,0" StartPoint="0,0">
<GradientStop Color="{DynamicResource SuccessColor}" Offset="0"/>
<GradientStop Color="{DynamicResource DarkSuccessColor}" Offset="1"/>
</LinearGradientBrush>
<SolidColorBrush x:Key="DarkSuccessBrush" Color="{DynamicResource DarkSuccessColor}"/>
<SolidColorBrush x:Key="AccentBrush" Color="{DynamicResource AccentColor}"/>
<SolidColorBrush x:Key="DarkAccentBrush" Color="{DynamicResource DarkAccentColor}"/>
<SolidColorBrush x:Key="DarkMaskBrush" Color="{DynamicResource DarkMaskColor}"/>
<SolidColorBrush x:Key="DarkOpacityBrush" Color="{DynamicResource DarkOpacityColor}"/>
</ResourceDictionary>
@@ -0,0 +1,98 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="using:System">
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<Color x:Key="LightPrimaryColor">#f3fbff</Color>
<Color x:Key="PrimaryColor">#326cf3</Color>
<Color x:Key="DarkPrimaryColor">#326cf3</Color>
<Color x:Key="LightDangerColor">#fff6f7</Color>
<Color x:Key="DangerColor">#db3340</Color>
<Color x:Key="DarkDangerColor">#db3340</Color>
<Color x:Key="LightWarningColor">#fffcf5</Color>
<Color x:Key="WarningColor">#e9af20</Color>
<Color x:Key="DarkWarningColor">#e9af20</Color>
<Color x:Key="LightInfoColor">#f1fdff</Color>
<Color x:Key="InfoColor">#00bcd4</Color>
<Color x:Key="DarkInfoColor">#00bcd4</Color>
<Color x:Key="LightSuccessColor">#f3fff6</Color>
<Color x:Key="SuccessColor">#2db84d</Color>
<Color x:Key="DarkSuccessColor">#2db84d</Color>
<Color x:Key="PrimaryTextColor">#212121</Color>
<Color x:Key="SecondaryTextColor">#757575</Color>
<Color x:Key="ThirdlyTextColor">#bdbdbd</Color>
<Color x:Key="ReverseTextColor">#212121</Color>
<Color x:Key="TextIconColor">White</Color>
<Color x:Key="BorderColor">#e0e0e0</Color>
<Color x:Key="SecondaryBorderColor">#757575</Color>
<Color x:Key="BackgroundColor">#eeeeee</Color>
<Color x:Key="RegionColor">#ffffff</Color>
<Color x:Key="SecondaryRegionColor">#eeeeee</Color>
<Color x:Key="ThirdlyRegionColor">White</Color>
<Color x:Key="TitleColor">#326cf3</Color>
<Color x:Key="SecondaryTitleColor">#326cf3</Color>
<Color x:Key="DefaultColor">White</Color>
<Color x:Key="DarkDefaultColor">#f5f5f5</Color>
<Color x:Key="AccentColor">#f8491e</Color>
<Color x:Key="DarkAccentColor">#f8491e</Color>
<Color x:Key="DarkMaskColor">#20000000</Color>
<Color x:Key="DarkOpacityColor">#40000000</Color>
<system:UInt32 x:Key="BlurGradientValue">2583691263</system:UInt32>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<Color x:Key="LightPrimaryColor">#044289</Color>
<Color x:Key="PrimaryColor">#326cf3</Color>
<Color x:Key="DarkPrimaryColor">#326cf3</Color>
<Color x:Key="LightDangerColor">#450c0f</Color>
<Color x:Key="DangerColor">#db3340</Color>
<Color x:Key="DarkDangerColor">#db3340</Color>
<Color x:Key="LightWarningColor">#4c3a0f</Color>
<Color x:Key="WarningColor">#e9af20</Color>
<Color x:Key="DarkWarningColor">#e9af20</Color>
<Color x:Key="LightInfoColor">#003c44</Color>
<Color x:Key="InfoColor">#00bcd4</Color>
<Color x:Key="DarkInfoColor">#00bcd4</Color>
<Color x:Key="LightSuccessColor">#113a1b</Color>
<Color x:Key="SuccessColor">#2db84d</Color>
<Color x:Key="DarkSuccessColor">#2db84d</Color>
<Color x:Key="PrimaryTextColor">White</Color>
<Color x:Key="SecondaryTextColor">#757575</Color>
<Color x:Key="ThirdlyTextColor">#3f3f46</Color>
<Color x:Key="ReverseTextColor">#212121</Color>
<Color x:Key="TextIconColor">White</Color>
<Color x:Key="BorderColor">#3f3f46</Color>
<Color x:Key="SecondaryBorderColor">#555555</Color>
<Color x:Key="BackgroundColor">#eeeeee</Color>
<Color x:Key="RegionColor">#1c1c1c</Color>
<Color x:Key="SecondaryRegionColor">#2d2d30</Color>
<Color x:Key="ThirdlyRegionColor">#424242</Color>
<Color x:Key="TitleColor">#326cf3</Color>
<Color x:Key="SecondaryTitleColor">#326cf3</Color>
<Color x:Key="DefaultColor">#686868</Color>
<Color x:Key="DarkDefaultColor">#686868</Color>
<Color x:Key="AccentColor">#ff5722</Color>
<Color x:Key="DarkAccentColor">#d43f3a</Color>
<Color x:Key="DarkMaskColor">#40000000</Color>
<Color x:Key="DarkOpacityColor">#40000000</Color>
<system:UInt32 x:Key="BlurGradientValue">2583691263</system:UInt32>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
@@ -0,0 +1,13 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Color x:Key="EffectShadowColor">#88000000</Color>
<DropShadowEffect x:Key="EffectShadow1" BlurRadius="5" OffsetY="1" Color="{StaticResource EffectShadowColor}" Opacity=".2" />
<DropShadowEffect x:Key="EffectShadow2" BlurRadius="8" OffsetY="1.5" Color="{StaticResource EffectShadowColor}" Opacity=".2" />
<DropShadowEffect x:Key="EffectShadow3" BlurRadius="14" OffsetY="4.5" Color="{StaticResource EffectShadowColor}" Opacity=".2" />
<DropShadowEffect x:Key="EffectShadow4" BlurRadius="25" OffsetY="8" Color="{StaticResource EffectShadowColor}" Opacity=".2" />
<DropShadowEffect x:Key="EffectShadow5" BlurRadius="35" OffsetY="13" Color="{StaticResource EffectShadowColor}" Opacity=".2" />
</ResourceDictionary>
@@ -0,0 +1,9 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="using:System">
<system:Double x:Key="DefaultControlHeight">28</system:Double>
<system:Double x:Key="SmallControlHeight">20</system:Double>
<Thickness x:Key="DefaultControlPadding">10,5</Thickness>
<Thickness x:Key="DefaultInputPadding">8,0</Thickness>
<CornerRadius x:Key="DefaultCornerRadius">4</CornerRadius>
</ResourceDictionary>
@@ -0,0 +1,102 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ControlTheme x:Key="{x:Type Button}" TargetType="Button">
<Setter Property="Background" Value="{DynamicResource RegionBrush}" />
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="{DynamicResource DefaultCornerRadius}" />
<Setter Property="Padding" Value="{DynamicResource DefaultControlPadding}" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<ControlTemplate TargetType="Button">
<ContentPresenter x:Name="PART_ContentPresenter"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Padding="{TemplateBinding Padding}"
RecognizesAccessKey="True"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" />
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource BorderBrush}" />
</Style>
<Style Selector="^:disabled">
<Setter Property="Opacity" Value=".4" />
</Style>
<Style Selector="^.primary">
<Setter Property="Foreground" Value="{DynamicResource TextIconBrush}" />
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Opacity" Value=".9" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Opacity" Value=".6" />
</Style>
</Style>
<Style Selector="^.success">
<Setter Property="Foreground" Value="{DynamicResource TextIconBrush}" />
<Setter Property="Background" Value="{DynamicResource SuccessBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource SuccessBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Opacity" Value=".9" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Opacity" Value=".6" />
</Style>
</Style>
<Style Selector="^.info">
<Setter Property="Foreground" Value="{DynamicResource TextIconBrush}" />
<Setter Property="Background" Value="{DynamicResource InfoBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource InfoBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Opacity" Value=".9" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Opacity" Value=".6" />
</Style>
</Style>
<Style Selector="^.warning">
<Setter Property="Foreground" Value="{DynamicResource TextIconBrush}" />
<Setter Property="Background" Value="{DynamicResource WarningBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource WarningBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Opacity" Value=".9" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Opacity" Value=".6" />
</Style>
</Style>
<Style Selector="^.danger">
<Setter Property="Foreground" Value="{DynamicResource TextIconBrush}" />
<Setter Property="Background" Value="{DynamicResource DangerBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource DangerBrush}" />
<Style Selector="^:pointerover">
<Setter Property="Opacity" Value=".9" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Opacity" Value=".6" />
</Style>
</Style>
</ControlTheme>
</ResourceDictionary>
@@ -0,0 +1,20 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ControlTheme x:Key="{x:Type ContentControl}" TargetType="ContentControl">
<Setter Property="Template">
<ControlTemplate TargetType="ContentControl">
<ContentPresenter
Name="PART_ContentPresenter"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}" />
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>
@@ -0,0 +1,17 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Styles.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<MergeResourceInclude Source="avares://HandyControl/Themes/Basic/Brushes.axaml" />
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/ContentControl.axaml" />
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/UserControl.axaml" />
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/Window.axaml" />
<MergeResourceInclude Source="avares://HandyControl/Themes/Styles/Button.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Styles.Resources>
<Style Selector=":is(UserControl)">
<Setter Property="Theme" Value="{DynamicResource {x:Type UserControl}}" />
</Style>
</Styles>
@@ -0,0 +1,20 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ControlTheme x:Key="{x:Type UserControl}" TargetType="UserControl">
<Setter Property="Template">
<ControlTemplate TargetType="UserControl">
<ContentPresenter
Name="PART_ContentPresenter"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
CornerRadius="{TemplateBinding CornerRadius}" />
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>
@@ -0,0 +1,31 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:ClassModifier="internal">
<ControlTheme x:Key="{x:Type Window}" TargetType="Window">
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
<Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource RegionBrush}" />
<Setter Property="TopLevel.SystemBarColor" Value="{DynamicResource RegionBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Template">
<ControlTemplate TargetType="Window">
<Panel>
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" />
<Border Background="{TemplateBinding Background}" IsHitTestVisible="False" />
<Panel Background="Transparent" Margin="{TemplateBinding WindowDecorationMargin}" />
<VisualLayerManager>
<VisualLayerManager.ChromeOverlayLayer>
<TitleBar />
</VisualLayerManager.ChromeOverlayLayer>
<ContentPresenter Name="PART_ContentPresenter"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
Margin="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
</VisualLayerManager>
</Panel>
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>
@@ -0,0 +1,15 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="HandyControl.Themes.Theme">
<Styles.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<MergeResourceInclude Source="/Themes/Basic/Colors.axaml" />
<MergeResourceInclude Source="/Themes/Basic/Sizes.axaml" />
<MergeResourceInclude Source="/Themes/Basic/Effects.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Styles.Resources>
<StyleInclude Source="/Themes/Styles/Style.axaml" />
</Styles>
@@ -0,0 +1,14 @@
using System;
using Avalonia.Markup.Xaml;
using Avalonia.Styling;
namespace HandyControl.Themes;
// ReSharper disable once PartialTypeWithSinglePart
public partial class Theme : Styles
{
public Theme(IServiceProvider? sp = null)
{
AvaloniaXamlLoader.Load(sp, this);
}
}
+39 -19
View File
@@ -36,26 +36,13 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "System.Windows.Interactivit
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Microsoft.Expression.Interactions", "Shared\Microsoft.Expression.Interactions\Microsoft.Expression.Interactions.shproj", "{3531857C-28FC-4E0F-82D9-BFBB70740E04}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Avalonia", "Avalonia", "{A490C3E9-0CC2-46EE-BE9A-95D3DCBF211D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HandyControl_Avalonia", "Avalonia\HandyControl_Avalonia\HandyControl_Avalonia.csproj", "{34D39209-C744-41AA-91D6-C15C68E2A1D9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HandyControlDemo_Avalonia", "Avalonia\HandyControlDemo_Avalonia\HandyControlDemo_Avalonia.csproj", "{99CCAF7C-F9A1-4C54-A5F0-B231E7F7AE66}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Shared\HandyControl_Shared\HandyControl_Shared.projitems*{32204503-2ef0-4681-ae13-aa1feb6c658a}*SharedItemsImports = 5
Shared\Microsoft.Expression.Drawing\Microsoft.Expression.Drawing.projitems*{32204503-2ef0-4681-ae13-aa1feb6c658a}*SharedItemsImports = 5
Shared\Microsoft.Expression.Interactions\Microsoft.Expression.Interactions.projitems*{32204503-2ef0-4681-ae13-aa1feb6c658a}*SharedItemsImports = 5
Shared\Microsoft.Windows.Shell\Microsoft.Windows.Shell.projitems*{32204503-2ef0-4681-ae13-aa1feb6c658a}*SharedItemsImports = 5
Shared\System.Windows.Interactivity\System.Windows.Interactivity.projitems*{32204503-2ef0-4681-ae13-aa1feb6c658a}*SharedItemsImports = 5
Shared\Microsoft.Expression.Interactions\Microsoft.Expression.Interactions.projitems*{3531857c-28fc-4e0f-82d9-bfbb70740e04}*SharedItemsImports = 13
Shared\System.Windows.Interactivity\System.Windows.Interactivity.projitems*{6f0c9cff-2269-46a7-9664-478354c582a4}*SharedItemsImports = 13
Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.projitems*{9a7b52e6-94bb-4e7e-bb6a-7cf6761b79a7}*SharedItemsImports = 5
Shared\HandyControl_Shared\HandyControl_Shared.projitems*{aac11083-faca-405d-9197-5c1212d65656}*SharedItemsImports = 13
Shared\Microsoft.Windows.Shell\Microsoft.Windows.Shell.projitems*{bbe51380-8b21-49ff-9cfc-b29447a40999}*SharedItemsImports = 13
Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.projitems*{c4694269-c9b8-45d5-87f8-d0088c532510}*SharedItemsImports = 13
Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.projitems*{d8ae88f8-c36b-4d10-a7f9-22ffcfba5231}*SharedItemsImports = 5
Shared\HandyControl_Shared\HandyControl_Shared.projitems*{dc966e3d-bcff-4652-98cf-070e5494749a}*SharedItemsImports = 5
Shared\Microsoft.Expression.Drawing\Microsoft.Expression.Drawing.projitems*{dc966e3d-bcff-4652-98cf-070e5494749a}*SharedItemsImports = 5
Shared\Microsoft.Expression.Interactions\Microsoft.Expression.Interactions.projitems*{dc966e3d-bcff-4652-98cf-070e5494749a}*SharedItemsImports = 5
Shared\System.Windows.Interactivity\System.Windows.Interactivity.projitems*{dc966e3d-bcff-4652-98cf-070e5494749a}*SharedItemsImports = 5
Shared\Microsoft.Expression.Drawing\Microsoft.Expression.Drawing.projitems*{e5dc7c25-6293-4660-b5fb-186496386b90}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug-Net40|Any CPU = Debug-Net40|Any CPU
@@ -95,6 +82,18 @@ Global
{D8A4748C-0500-4F63-BC47-3506658C68F7}.Release|Any CPU.Build.0 = Release|Any CPU
{D8A4748C-0500-4F63-BC47-3506658C68F7}.Release-Net40|Any CPU.ActiveCfg = Release|Any CPU
{D8A4748C-0500-4F63-BC47-3506658C68F7}.Release-Net40|Any CPU.Build.0 = Release|Any CPU
{34D39209-C744-41AA-91D6-C15C68E2A1D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{34D39209-C744-41AA-91D6-C15C68E2A1D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{34D39209-C744-41AA-91D6-C15C68E2A1D9}.Debug-Net40|Any CPU.ActiveCfg = Debug|Any CPU
{34D39209-C744-41AA-91D6-C15C68E2A1D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34D39209-C744-41AA-91D6-C15C68E2A1D9}.Release|Any CPU.Build.0 = Release|Any CPU
{34D39209-C744-41AA-91D6-C15C68E2A1D9}.Release-Net40|Any CPU.ActiveCfg = Release|Any CPU
{99CCAF7C-F9A1-4C54-A5F0-B231E7F7AE66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{99CCAF7C-F9A1-4C54-A5F0-B231E7F7AE66}.Debug|Any CPU.Build.0 = Debug|Any CPU
{99CCAF7C-F9A1-4C54-A5F0-B231E7F7AE66}.Debug-Net40|Any CPU.ActiveCfg = Debug|Any CPU
{99CCAF7C-F9A1-4C54-A5F0-B231E7F7AE66}.Release|Any CPU.ActiveCfg = Release|Any CPU
{99CCAF7C-F9A1-4C54-A5F0-B231E7F7AE66}.Release|Any CPU.Build.0 = Release|Any CPU
{99CCAF7C-F9A1-4C54-A5F0-B231E7F7AE66}.Release-Net40|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -111,8 +110,29 @@ Global
{E5DC7C25-6293-4660-B5FB-186496386B90} = {0938270D-E9F0-489B-AF9E-5C5AD7C69897}
{6F0C9CFF-2269-46A7-9664-478354C582A4} = {0938270D-E9F0-489B-AF9E-5C5AD7C69897}
{3531857C-28FC-4E0F-82D9-BFBB70740E04} = {0938270D-E9F0-489B-AF9E-5C5AD7C69897}
{34D39209-C744-41AA-91D6-C15C68E2A1D9} = {A490C3E9-0CC2-46EE-BE9A-95D3DCBF211D}
{99CCAF7C-F9A1-4C54-A5F0-B231E7F7AE66} = {A490C3E9-0CC2-46EE-BE9A-95D3DCBF211D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D4636382-1A18-4079-A3E7-054DD970F179}
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Shared\HandyControl_Shared\HandyControl_Shared.projitems*{32204503-2ef0-4681-ae13-aa1feb6c658a}*SharedItemsImports = 5
Shared\Microsoft.Expression.Drawing\Microsoft.Expression.Drawing.projitems*{32204503-2ef0-4681-ae13-aa1feb6c658a}*SharedItemsImports = 5
Shared\Microsoft.Expression.Interactions\Microsoft.Expression.Interactions.projitems*{32204503-2ef0-4681-ae13-aa1feb6c658a}*SharedItemsImports = 5
Shared\Microsoft.Windows.Shell\Microsoft.Windows.Shell.projitems*{32204503-2ef0-4681-ae13-aa1feb6c658a}*SharedItemsImports = 5
Shared\System.Windows.Interactivity\System.Windows.Interactivity.projitems*{32204503-2ef0-4681-ae13-aa1feb6c658a}*SharedItemsImports = 5
Shared\Microsoft.Expression.Interactions\Microsoft.Expression.Interactions.projitems*{3531857c-28fc-4e0f-82d9-bfbb70740e04}*SharedItemsImports = 13
Shared\System.Windows.Interactivity\System.Windows.Interactivity.projitems*{6f0c9cff-2269-46a7-9664-478354c582a4}*SharedItemsImports = 13
Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.projitems*{9a7b52e6-94bb-4e7e-bb6a-7cf6761b79a7}*SharedItemsImports = 5
Shared\HandyControl_Shared\HandyControl_Shared.projitems*{aac11083-faca-405d-9197-5c1212d65656}*SharedItemsImports = 13
Shared\Microsoft.Windows.Shell\Microsoft.Windows.Shell.projitems*{bbe51380-8b21-49ff-9cfc-b29447a40999}*SharedItemsImports = 13
Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.projitems*{c4694269-c9b8-45d5-87f8-d0088c532510}*SharedItemsImports = 13
Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.projitems*{d8ae88f8-c36b-4d10-a7f9-22ffcfba5231}*SharedItemsImports = 5
Shared\HandyControl_Shared\HandyControl_Shared.projitems*{dc966e3d-bcff-4652-98cf-070e5494749a}*SharedItemsImports = 5
Shared\Microsoft.Expression.Drawing\Microsoft.Expression.Drawing.projitems*{dc966e3d-bcff-4652-98cf-070e5494749a}*SharedItemsImports = 5
Shared\Microsoft.Expression.Interactions\Microsoft.Expression.Interactions.projitems*{dc966e3d-bcff-4652-98cf-070e5494749a}*SharedItemsImports = 5
Shared\System.Windows.Interactivity\System.Windows.Interactivity.projitems*{dc966e3d-bcff-4652-98cf-070e5494749a}*SharedItemsImports = 5
Shared\Microsoft.Expression.Drawing\Microsoft.Expression.Drawing.projitems*{e5dc7c25-6293-4660-b5fb-186496386b90}*SharedItemsImports = 13
EndGlobalSection
EndGlobal