feat: initialize control.
This commit is contained in:
23
src/Ursa.Themes.Semi/Controls/Divider.axaml
Normal file
23
src/Ursa.Themes.Semi/Controls/Divider.axaml
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
<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 x:Key="{x:Type u:Divider}" TargetType="u:Divider">
|
||||||
|
<Setter Property="u:Divider.Template">
|
||||||
|
<ControlTemplate TargetType="u:Divider">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<Border
|
||||||
|
BorderBrush="Gray"
|
||||||
|
BorderDashArray="{TemplateBinding DashArray}"
|
||||||
|
BorderThickness="0,0,0,1" />
|
||||||
|
<ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" />
|
||||||
|
<Border
|
||||||
|
BorderBrush="Gray"
|
||||||
|
BorderDashArray="{TemplateBinding DashArray}"
|
||||||
|
BorderThickness="0,0,0,1" />
|
||||||
|
</StackPanel>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter>
|
||||||
|
</ControlTheme>
|
||||||
|
</ResourceDictionary>
|
||||||
17
src/Ursa/Controls/Divider.cs
Normal file
17
src/Ursa/Controls/Divider.cs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
using Avalonia;
|
||||||
|
using Avalonia.Collections;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
using Avalonia.Controls.Shapes;
|
||||||
|
|
||||||
|
namespace Ursa.Controls;
|
||||||
|
|
||||||
|
public class Divider : ContentControl
|
||||||
|
{
|
||||||
|
public static readonly StyledProperty<AvaloniaList<double>?> DashArrayProperty = Shape.StrokeDashArrayProperty.AddOwner<Divider>();
|
||||||
|
|
||||||
|
public AvaloniaList<double>? DashArray
|
||||||
|
{
|
||||||
|
get => GetValue(DashArrayProperty);
|
||||||
|
set => SetValue(DashArrayProperty, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user