feat: initialize control.

This commit is contained in:
rabbitism
2023-07-28 01:44:42 +08:00
parent cde1caabd4
commit cd32818e85
5 changed files with 115 additions and 5 deletions

View File

@@ -0,0 +1,26 @@
<ResourceDictionary
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="using:Avalonia.Controls.Converters"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<converters:PlatformKeyGestureConverter x:Key="KeyGestureConverter" />
<ControlTheme x:Key="{x:Type u:KeyGestureInput}" TargetType="u:KeyGestureInput">
<Setter Property="Template">
<ControlTemplate TargetType="u:KeyGestureInput">
<Border
Name="Background"
Width="100"
MinHeight="32"
Background="LightBlue"
BorderThickness="1">
<TextBlock Text="{TemplateBinding Gesture, Converter={StaticResource KeyGestureConverter}}" />
</Border>
</ControlTemplate>
</Setter>
<Style Selector="^:focus-within /template/ Border#Background">
<Setter Property="BorderBrush" Value="Blue" />
</Style>
</ControlTheme>
</ResourceDictionary>

View File

@@ -6,6 +6,7 @@
<ResourceInclude Source="ButtonGroup.axaml" />
<ResourceInclude Source="Divider.axaml" />
<ResourceInclude Source="IPv4Box.axaml" />
<ResourceInclude Source="KeyGestureInput.axaml" />
<ResourceInclude Source="Loading.axaml" />
<ResourceInclude Source="Navigation.axaml" />
<ResourceInclude Source="Pagination.axaml" />

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../Package.props"/>
<Import Project="../Package.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
@@ -13,11 +13,11 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)"/>
<PackageReference Include="Avalonia" Version="$(AvaloniaVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Ursa\Ursa.csproj"/>
<ProjectReference Include="..\Ursa\Ursa.csproj" />
</ItemGroup>
</Project>