feat: initialize.

This commit is contained in:
rabbitism
2024-03-09 16:00:51 +08:00
parent f93cd69d7c
commit de0124eb8e
9 changed files with 215 additions and 1 deletions

View File

@@ -0,0 +1,34 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme TargetType="u:VerificationCode" x:Key="{x:Type u:VerificationCode}">
<Setter Property="Template">
<ControlTemplate TargetType="u:VerificationCode">
<u:VerificationCodeCollection Name="{x:Static u:VerificationCode.PART_ItemsControl}" ItemsSource="{TemplateBinding Digits}">
<u:VerificationCodeCollection.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="{TemplateBinding CountOfDigit}" Rows="1"></UniformGrid>
</ItemsPanelTemplate>
</u:VerificationCodeCollection.ItemsPanel>
<u:VerificationCodeCollection.ItemContainerTheme>
<ControlTheme TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="IsReadOnly" Value="True"></Setter>
<Setter Property="Focusable" Value="False"></Setter>
<Setter Property="Margin" Value="8"></Setter>
<Setter Property="PasswordChar" Value="{Binding $parent[u:VerificationCode].PasswordChar}"></Setter>
</ControlTheme>
</u:VerificationCodeCollection.ItemContainerTheme>
</u:VerificationCodeCollection>
</ControlTemplate>
</Setter>
</ControlTheme>
<ControlTheme TargetType="u:VerificationCodeCollection" x:Key="{x:Type u:VerificationCodeCollection}">
<Setter Property="Template">
<ControlTemplate TargetType="u:VerificationCodeCollection">
<ItemsPresenter ItemsPanel="{TemplateBinding ItemsPanel}"></ItemsPresenter>
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>

View File

@@ -33,5 +33,6 @@
<ResourceInclude Source="Skeleton.axaml" />
<ResourceInclude Source="TwoTonePathIcon.axaml" />
<ResourceInclude Source="ToolBar.axaml" />
<ResourceInclude Source="VerificationCode.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>