-
Notifications
You must be signed in to change notification settings - Fork 1
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
8 changed files
with
381 additions
and
246 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 |
---|---|---|
@@ -1,16 +1,33 @@ | ||
<Application xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
x:Class="AvaloniaApp.App" | ||
RequestedThemeVariant="Default"> | ||
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. --> | ||
|
||
<Application.Styles> | ||
<FluentTheme> | ||
<FluentTheme.Palettes> | ||
<ColorPaletteResources x:Key="Light" Accent="#ffcc4d11" AltHigh="White" AltLow="White" AltMedium="White" AltMediumHigh="White" AltMediumLow="White" BaseHigh="Black" BaseLow="#ff7cbee0" BaseMedium="#ff3282a8" BaseMediumHigh="#ff005a83" BaseMediumLow="#ff196e96" ChromeAltLow="#ff005a83" ChromeBlackHigh="Black" ChromeBlackLow="#ff7cbee0" ChromeBlackMedium="#ff005a83" ChromeBlackMediumLow="#ff3282a8" ChromeDisabledHigh="#ff7cbee0" ChromeDisabledLow="#ff3282a8" ChromeGray="#ff196e96" ChromeHigh="#ff7cbee0" ChromeLow="#ffc1e9fe" ChromeMedium="#ffb3e0f8" ChromeMediumLow="#ffc1e9fe" ChromeWhite="White" ListLow="#ffb3e0f8" ListMedium="#ff7cbee0" RegionColor="#ffcfeaff" /> | ||
<ColorPaletteResources x:Key="Dark" Accent="#ffcc4d11" AltHigh="Black" AltLow="Black" AltMedium="Black" AltMediumHigh="Black" AltMediumLow="Black" BaseHigh="White" BaseLow="#ff2f7bad" BaseMedium="#ff8dbfdf" BaseMediumHigh="#ffa5d0ec" BaseMediumLow="#ff5e9dc6" ChromeAltLow="#ffa5d0ec" ChromeBlackHigh="Black" ChromeBlackLow="#ffa5d0ec" ChromeBlackMedium="Black" ChromeBlackMediumLow="Black" ChromeDisabledHigh="#ff2f7bad" ChromeDisabledLow="#ff8dbfdf" ChromeGray="#ff76aed3" ChromeHigh="#ff76aed3" ChromeLow="#ff093b73" ChromeMedium="#ff134b82" ChromeMediumLow="#ff266b9f" ChromeWhite="White" ListLow="#ff134b82" ListMedium="#ff2f7bad" RegionColor="#ff0d2644" /> | ||
</FluentTheme.Palettes> | ||
</FluentTheme> | ||
<StyleInclude Source="avares://AvaloniaIconPacks/BoxIcons.xaml"/> | ||
</Application.Styles> | ||
<Application xmlns="https://github.com/avaloniaui" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
x:Class="AvaloniaApp.App" | ||
RequestedThemeVariant="Default"> | ||
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. --> | ||
|
||
<Application.Styles> | ||
<FluentTheme> | ||
<FluentTheme.Palettes> | ||
<ColorPaletteResources x:Key="Light" Accent="#ffcc4d11" AltHigh="White" AltLow="White" | ||
AltMedium="White" AltMediumHigh="White" AltMediumLow="White" BaseHigh="Black" | ||
BaseLow="#ff7cbee0" BaseMedium="#ff3282a8" BaseMediumHigh="#ff005a83" | ||
BaseMediumLow="#ff196e96" ChromeAltLow="#ff005a83" ChromeBlackHigh="Black" | ||
ChromeBlackLow="#ff7cbee0" ChromeBlackMedium="#ff005a83" | ||
ChromeBlackMediumLow="#ff3282a8" ChromeDisabledHigh="#ff7cbee0" | ||
ChromeDisabledLow="#ff3282a8" ChromeGray="#ff196e96" ChromeHigh="#ff7cbee0" | ||
ChromeLow="#ffc1e9fe" ChromeMedium="#ffb3e0f8" ChromeMediumLow="#ffc1e9fe" | ||
ChromeWhite="White" ListLow="#ffb3e0f8" ListMedium="#ff7cbee0" | ||
RegionColor="#ffcfeaff" /> | ||
<ColorPaletteResources x:Key="Dark" Accent="#ffcc4d11" AltHigh="Black" AltLow="Black" AltMedium="Black" | ||
AltMediumHigh="Black" AltMediumLow="Black" BaseHigh="White" BaseLow="#ff2f7bad" | ||
BaseMedium="#ff8dbfdf" BaseMediumHigh="#ffa5d0ec" BaseMediumLow="#ff5e9dc6" | ||
ChromeAltLow="#ffa5d0ec" ChromeBlackHigh="Black" ChromeBlackLow="#ffa5d0ec" | ||
ChromeBlackMedium="Black" ChromeBlackMediumLow="Black" | ||
ChromeDisabledHigh="#ff2f7bad" ChromeDisabledLow="#ff8dbfdf" | ||
ChromeGray="#ff76aed3" ChromeHigh="#ff76aed3" ChromeLow="#ff093b73" | ||
ChromeMedium="#ff134b82" ChromeMediumLow="#ff266b9f" ChromeWhite="White" | ||
ListLow="#ff134b82" ListMedium="#ff2f7bad" RegionColor="#ff0d2644" /> | ||
</FluentTheme.Palettes> | ||
</FluentTheme> | ||
<!-- <StyleInclude Source="avares://AvaloniaIconPacks/BoxIcons.xaml"/> --> | ||
</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 |
---|---|---|
@@ -1,24 +1,24 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport> | ||
<ApplicationManifest>app.manifest</ApplicationManifest> | ||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Avalonia" Version="11.0.6" /> | ||
<PackageReference Include="Avalonia.Desktop" Version="11.0.6" /> | ||
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.6" /> | ||
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.0.6" /> | ||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> | ||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.6" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\AvaloniaIconPacks\AvaloniaIconPacks.csproj" /> | ||
</ItemGroup> | ||
|
||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>WinExe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport> | ||
<ApplicationManifest>app.manifest</ApplicationManifest> | ||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Avalonia" Version="11.1.4" /> | ||
<PackageReference Include="Avalonia.Desktop" Version="11.1.4" /> | ||
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.1.4" /> | ||
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.1.4" /> | ||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.--> | ||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.4" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\AvaloniaIconPacks\AvaloniaIconPacks.csproj" /> | ||
</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,26 @@ | ||
using Avalonia.Data; | ||
using Avalonia.Markup.Xaml.MarkupExtensions; | ||
using Avalonia.Markup.Xaml; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace AvaloniaApp | ||
{ | ||
public class EnumsExtension : MarkupExtension | ||
{ | ||
private readonly Type _type; | ||
|
||
public EnumsExtension(Type type) => _type = type; | ||
|
||
public override object ProvideValue(IServiceProvider serviceProvider) | ||
{ | ||
var binding = new CompiledBindingExtension() | ||
{ | ||
Mode = BindingMode.OneTime, | ||
DataType = typeof(IEnumerable<>).MakeGenericType(_type), | ||
Source = Enum.GetValues(_type) | ||
}; | ||
return binding; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,64 +1,74 @@ | ||
<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:iconPacks="clr-namespace:MahApps.Metro.IconPacks;assembly=AvaloniaIconPacks" | ||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" | ||
x:Class="AvaloniaApp.MainWindow" | ||
Title="AvaloniaApp"> | ||
|
||
<ScrollViewer> | ||
<StackPanel Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10"> | ||
<TextBlock Margin="0 10" Text="Welcome to Avalonia!" FontSize="22" FontWeight="SemiBold" /> | ||
<TextBlock Margin="0 10" Text="IconPacks - PackIconBoxIcons" FontSize="18" FontWeight="SemiBold" /> | ||
|
||
<ComboBox Name="FlipOrientation" Width="200" SelectedIndex="1"> | ||
<iconPacks:PackIconFlipOrientation>Horizontal</iconPacks:PackIconFlipOrientation> | ||
<iconPacks:PackIconFlipOrientation>Vertical</iconPacks:PackIconFlipOrientation> | ||
<iconPacks:PackIconFlipOrientation>Both</iconPacks:PackIconFlipOrientation> | ||
<iconPacks:PackIconFlipOrientation>Normal</iconPacks:PackIconFlipOrientation> | ||
</ComboBox> | ||
|
||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5"> | ||
<iconPacks:PackIconBoxIcons Kind="RegularRecycle" | ||
Foreground="{DynamicResource SystemControlHighlightAccentBrush}" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
Margin="5" | ||
Width="144" Height="144" /> | ||
<iconPacks:PackIconBoxIcons Kind="RegularRecycle" | ||
Foreground="{DynamicResource SystemControlHighlightAccentBrush}" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
Width="144" Height="144" | ||
Flip="{Binding #FlipOrientation.SelectedItem, Mode=OneWay}" /> | ||
</StackPanel> | ||
|
||
<TextBlock Margin="0 10" | ||
Text="{Binding #RotationSlider.Value, Mode=OneWay, StringFormat='RotationAngle {0}'}" | ||
FontSize="22" FontWeight="SemiBold" /> | ||
<Slider Name="RotationSlider" Margin="0 2" Width="200" Minimum="0" Maximum="360" Value="45" SmallChange="1" | ||
LargeChange="10" TickFrequency="1" IsSnapToTickEnabled="True" /> | ||
|
||
<TextBlock Margin="0 2" Text="{Binding #DurationSlider.Value, Mode=OneWay, StringFormat='Duration {0}'}" | ||
FontSize="22" FontWeight="SemiBold" /> | ||
<Slider Name="DurationSlider" Margin="0 2" Width="200" Minimum="0" Maximum="10" Value="3" SmallChange="1" | ||
LargeChange="2" TickFrequency="1" IsSnapToTickEnabled="True" /> | ||
|
||
<CheckBox Name="SpinCheckBox" Margin="0 2" Content="Spin" IsChecked="True" /> | ||
<CheckBox Name="VisibilityCheckBox" Margin="0 2" Content="Visible" IsChecked="True" /> | ||
|
||
<iconPacks:PackIconBoxIcons Kind="RegularCog" | ||
Foreground="{DynamicResource SystemControlHighlightAccentBrush}" | ||
ClipToBounds="False" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
Width="144" Height="144" | ||
IsVisible="{Binding #VisibilityCheckBox.IsChecked, Mode=OneWay}" | ||
Spin="{Binding #SpinCheckBox.IsChecked, Mode=OneWay}" | ||
RotationAngle="{Binding #RotationSlider.Value, Mode=OneWay}" | ||
SpinDuration="{Binding #DurationSlider.Value, Mode=OneWay}" /> | ||
|
||
</StackPanel> | ||
</ScrollViewer> | ||
<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:iconPacks="clr-namespace:MahApps.Metro.IconPacks;assembly=AvaloniaIconPacks" | ||
xmlns:avaloniaApp="clr-namespace:AvaloniaApp" | ||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" | ||
x:Class="AvaloniaApp.MainWindow" | ||
Title="AvaloniaApp" | ||
WindowStartupLocation="CenterScreen" | ||
SizeToContent="WidthAndHeight"> | ||
|
||
<ScrollViewer> | ||
<StackPanel Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10"> | ||
<TextBlock Margin="0 10" Text="Welcome to Avalonia!" FontSize="22" FontWeight="SemiBold" /> | ||
<TextBlock Margin="0 10" Text="IconPacks - PackIconBoxIcons" FontSize="18" FontWeight="SemiBold" /> | ||
|
||
<ComboBox Name="BoxIcons" Width="200" ItemsSource="{avaloniaApp:Enums iconPacks:PackIconBoxIconsKind}" | ||
SelectedItem="{x:Static iconPacks:PackIconBoxIconsKind.RegularRecycle}" /> | ||
|
||
<iconPacks:PackIconBoxIcons Margin="10" | ||
Kind="{Binding #BoxIcons.SelectedItem, Mode=OneWay}" | ||
Foreground="{DynamicResource SystemControlHighlightAccentBrush}" /> | ||
|
||
<ComboBox Name="FlipOrientation" Width="200" SelectedIndex="1"> | ||
<iconPacks:PackIconFlipOrientation>Horizontal</iconPacks:PackIconFlipOrientation> | ||
<iconPacks:PackIconFlipOrientation>Vertical</iconPacks:PackIconFlipOrientation> | ||
<iconPacks:PackIconFlipOrientation>Both</iconPacks:PackIconFlipOrientation> | ||
<iconPacks:PackIconFlipOrientation>Normal</iconPacks:PackIconFlipOrientation> | ||
</ComboBox> | ||
|
||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5"> | ||
<iconPacks:PackIconBoxIcons Kind="{Binding #BoxIcons.SelectedItem, Mode=OneWay}" | ||
Foreground="{DynamicResource SystemControlHighlightAccentBrush}" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
Margin="5" | ||
Width="144" Height="144" /> | ||
<iconPacks:PackIconBoxIcons Kind="{Binding #BoxIcons.SelectedItem, Mode=OneWay}" | ||
Foreground="{DynamicResource SystemControlHighlightAccentBrush}" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
Width="144" Height="144" | ||
Flip="{Binding #FlipOrientation.SelectedItem, Mode=OneWay}" /> | ||
</StackPanel> | ||
|
||
<TextBlock Margin="0 10" | ||
Text="{Binding #RotationSlider.Value, Mode=OneWay, StringFormat='RotationAngle {0}'}" | ||
FontSize="22" FontWeight="SemiBold" /> | ||
<Slider Name="RotationSlider" Margin="0 2" Width="200" Minimum="0" Maximum="360" Value="45" SmallChange="1" | ||
LargeChange="10" TickFrequency="1" IsSnapToTickEnabled="True" /> | ||
|
||
<TextBlock Margin="0 2" Text="{Binding #DurationSlider.Value, Mode=OneWay, StringFormat='Duration {0}'}" | ||
FontSize="22" FontWeight="SemiBold" /> | ||
<Slider Name="DurationSlider" Margin="0 2" Width="200" Minimum="0" Maximum="10" Value="3" SmallChange="1" | ||
LargeChange="2" TickFrequency="1" IsSnapToTickEnabled="True" /> | ||
|
||
<CheckBox Name="SpinCheckBox" Margin="0 2" Content="Spin" IsChecked="True" /> | ||
<CheckBox Name="VisibilityCheckBox" Margin="0 2" Content="Visible" IsChecked="True" /> | ||
|
||
<iconPacks:PackIconBoxIcons Kind="RegularCog" | ||
Foreground="{DynamicResource SystemControlHighlightAccentBrush}" | ||
ClipToBounds="False" | ||
HorizontalAlignment="Center" | ||
VerticalAlignment="Center" | ||
Width="144" Height="144" | ||
IsVisible="{Binding #VisibilityCheckBox.IsChecked, Mode=OneWay}" | ||
Spin="{Binding #SpinCheckBox.IsChecked, Mode=OneWay}" | ||
RotationAngle="{Binding #RotationSlider.Value, Mode=OneWay}" | ||
SpinDuration="{Binding #DurationSlider.Value, Mode=OneWay}" /> | ||
|
||
</StackPanel> | ||
</ScrollViewer> | ||
</Window> |
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks> | ||
<DefineConstants>$(DefineConstants);AVALONIA</DefineConstants> | ||
<LangVersion>latest</LangVersion> | ||
<Nullable>disable</Nullable> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<AvaloniaResource Include="**/*.xaml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Avalonia" Version="11.0.6" /> | ||
<PackageReference Include="Avalonia.ReactiveUI" Version="11.0.6" /> | ||
</ItemGroup> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFrameworks>net8.0;net6.0;netstandard2.0</TargetFrameworks> | ||
<DefineConstants>$(DefineConstants);AVALONIA</DefineConstants> | ||
<LangVersion>latest</LangVersion> | ||
<Nullable>disable</Nullable> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<AvaloniaResource Include="**/*.xaml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Avalonia" Version="11.1.4" /> | ||
<PackageReference Include="Avalonia.ReactiveUI" Version="11.1.4" /> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.