-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
687 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<Nullable>enable</Nullable> | ||
<AvaloniaVersion>11.0.6</AvaloniaVersion> | ||
</PropertyGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/Avalonia/HandyControlDemo_Avalonia/HandyControlDemo_Avalonia.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
11 changes: 11 additions & 0 deletions
11
src/Avalonia/HandyControlDemo_Avalonia/MainWindow.axaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Avalonia.Controls; | ||
|
||
namespace HandyControlDemo; | ||
|
||
public partial class MainWindow : Window | ||
{ | ||
public MainWindow() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
src/Avalonia/HandyControlDemo_Avalonia/Resources/Themes/Basic/Basic.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
8 changes: 8 additions & 0 deletions
8
src/Avalonia/HandyControlDemo_Avalonia/Resources/Themes/Basic/Brushes.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
10 changes: 10 additions & 0 deletions
10
src/Avalonia/HandyControlDemo_Avalonia/Resources/Themes/Theme.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
22 changes: 22 additions & 0 deletions
22
src/Avalonia/HandyControlDemo_Avalonia/Views/Main/MainWindowContent.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
11 changes: 11 additions & 0 deletions
11
src/Avalonia/HandyControlDemo_Avalonia/Views/Main/MainWindowContent.axaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Avalonia.Controls; | ||
|
||
namespace HandyControlDemo.Views; | ||
|
||
public partial class MainWindowContent : UserControl | ||
{ | ||
public MainWindowContent() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/Avalonia/HandyControlDemo_Avalonia/Views/Styles/ButtonDemoCtrl.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
11 changes: 11 additions & 0 deletions
11
src/Avalonia/HandyControlDemo_Avalonia/Views/Styles/ButtonDemoCtrl.axaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Avalonia.Controls; | ||
|
||
namespace HandyControlDemo.Views; | ||
|
||
public partial class ButtonDemoCtrl : UserControl | ||
{ | ||
public ButtonDemoCtrl() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
13 changes: 13 additions & 0 deletions
13
src/Avalonia/HandyControl_Avalonia/HandyControl_Avalonia.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
4 changes: 4 additions & 0 deletions
4
src/Avalonia/HandyControl_Avalonia/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
using Avalonia.Metadata; | ||
|
||
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Themes")] | ||
[assembly: XmlnsPrefix("https://handyorg.github.io/handycontrol", "hc")] |
64 changes: 64 additions & 0 deletions
64
src/Avalonia/HandyControl_Avalonia/Themes/Basic/Brushes.axaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
Oops, something went wrong.