Merge pull request #349 from irihitech/UrsaView

Ursa view
This commit is contained in:
Zhang Dian
2024-08-14 22:16:11 +08:00
committed by GitHub
15 changed files with 189 additions and 12 deletions

View File

@@ -29,6 +29,15 @@ public class TitleBar: ContentControl
get => GetValue(RightContentProperty);
set => SetValue(RightContentProperty, value);
}
public static readonly StyledProperty<bool> IsTitleVisibleProperty = AvaloniaProperty.Register<TitleBar, bool>(
nameof(IsTitleVisible));
public bool IsTitleVisible
{
get => GetValue(IsTitleVisibleProperty);
set => SetValue(IsTitleVisibleProperty, value);
}
protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
{

View File

@@ -0,0 +1,55 @@
using Avalonia;
using Avalonia.Controls;
namespace Ursa.Controls;
/// <summary>
/// Ursa window is designed to
/// </summary>
public class UrsaView: ContentControl
{
public static readonly StyledProperty<bool> IsTitleBarVisibleProperty =
UrsaWindow.IsTitleBarVisibleProperty.AddOwner<UrsaView>();
public bool IsTitleBarVisible
{
get => GetValue(IsTitleBarVisibleProperty);
set => SetValue(IsTitleBarVisibleProperty, value);
}
public static readonly StyledProperty<object?> LeftContentProperty =
UrsaWindow.LeftContentProperty.AddOwner<UrsaView>();
public object? LeftContent
{
get => GetValue(LeftContentProperty);
set => SetValue(LeftContentProperty, value);
}
public static readonly StyledProperty<object?> RightContentProperty =
UrsaWindow.RightContentProperty.AddOwner<UrsaView>();
public object? RightContent
{
get => GetValue(RightContentProperty);
set => SetValue(RightContentProperty, value);
}
public static readonly StyledProperty<object?> TitleBarContentProperty =
UrsaWindow.TitleBarContentProperty.AddOwner<UrsaView>();
public object? TitleBarContent
{
get => GetValue(TitleBarContentProperty);
set => SetValue(TitleBarContentProperty, value);
}
public static readonly StyledProperty<Thickness> TitleBarMarginProperty =
UrsaWindow.TitleBarMarginProperty.AddOwner<UrsaView>();
public Thickness TitleBarMargin
{
get => GetValue(TitleBarMarginProperty);
set => SetValue(TitleBarMarginProperty, value);
}
}

View File

@@ -47,7 +47,7 @@ public class UrsaWindow: Window
}
public static readonly StyledProperty<bool> IsTitleBarVisibleProperty = AvaloniaProperty.Register<UrsaWindow, bool>(
nameof(IsTitleBarVisible));
nameof(IsTitleBarVisible), true);
public bool IsTitleBarVisible
{