@@ -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)
|
||||
{
|
||||
|
||||
55
src/Ursa/Windows/UrsaView.cs
Normal file
55
src/Ursa/Windows/UrsaView.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user