diff --git a/demo/Ursa.Demo/Views/MainWindow.axaml b/demo/Ursa.Demo/Views/MainWindow.axaml index 45760f5..d548ae6 100644 --- a/demo/Ursa.Demo/Views/MainWindow.axaml +++ b/demo/Ursa.Demo/Views/MainWindow.axaml @@ -16,9 +16,7 @@ Icon="/Assets/Ursa.ico" mc:Ignorable="d"> - + \ No newline at end of file diff --git a/demo/Ursa.Demo/Views/SingleView.axaml b/demo/Ursa.Demo/Views/SingleView.axaml index 2065973..f447a48 100644 --- a/demo/Ursa.Demo/Views/SingleView.axaml +++ b/demo/Ursa.Demo/Views/SingleView.axaml @@ -1,4 +1,4 @@ - - - - - - + + + + + diff --git a/demo/Ursa.Demo/Views/SingleView.axaml.cs b/demo/Ursa.Demo/Views/SingleView.axaml.cs index 5a20b4f..ca15c4c 100644 --- a/demo/Ursa.Demo/Views/SingleView.axaml.cs +++ b/demo/Ursa.Demo/Views/SingleView.axaml.cs @@ -1,8 +1,9 @@ using Avalonia.Controls; +using Ursa.Controls; namespace Ursa.Demo.Views; -public partial class SingleView : UserControl +public partial class SingleView : UrsaView { public SingleView() { diff --git a/demo/Ursa.Demo/Views/TitleBarRightContent.axaml b/demo/Ursa.Demo/Views/TitleBarRightContent.axaml new file mode 100644 index 0000000..dd4d12b --- /dev/null +++ b/demo/Ursa.Demo/Views/TitleBarRightContent.axaml @@ -0,0 +1,20 @@ + + + + + + diff --git a/demo/Ursa.Demo/Views/TitleBarRightContent.axaml.cs b/demo/Ursa.Demo/Views/TitleBarRightContent.axaml.cs new file mode 100644 index 0000000..026dc57 --- /dev/null +++ b/demo/Ursa.Demo/Views/TitleBarRightContent.axaml.cs @@ -0,0 +1,23 @@ +using System; +using Avalonia; +using Avalonia.Controls; +using Avalonia.Interactivity; +using Avalonia.Markup.Xaml; + +namespace Ursa.Demo.Views; + +public partial class TitleBarRightContent : UserControl +{ + public TitleBarRightContent() + { + InitializeComponent(); + } + + private async void OpenRepository(object? sender, RoutedEventArgs e) + { + var top = TopLevel.GetTopLevel(this); + if (top is null) return; + var launcher = top.Launcher; + await launcher.LaunchUriAsync(new Uri("https://github.com/irihitech/Semi.Avalonia")); + } +} \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Controls/UrsaView.axaml b/src/Ursa.Themes.Semi/Controls/UrsaView.axaml new file mode 100644 index 0000000..e67c584 --- /dev/null +++ b/src/Ursa.Themes.Semi/Controls/UrsaView.axaml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Ursa.Themes.Semi/Controls/_index.axaml b/src/Ursa.Themes.Semi/Controls/_index.axaml index 36e75e7..bec20a1 100644 --- a/src/Ursa.Themes.Semi/Controls/_index.axaml +++ b/src/Ursa.Themes.Semi/Controls/_index.axaml @@ -48,6 +48,7 @@ + diff --git a/src/Ursa/Windows/UrsaView.cs b/src/Ursa/Windows/UrsaView.cs new file mode 100644 index 0000000..36e4828 --- /dev/null +++ b/src/Ursa/Windows/UrsaView.cs @@ -0,0 +1,55 @@ +using Avalonia; +using Avalonia.Controls; + +namespace Ursa.Controls; + +/// +/// Ursa window is designed to +/// +public class UrsaView: ContentControl +{ + public static readonly StyledProperty IsTitleBarVisibleProperty = + UrsaWindow.IsTitleBarVisibleProperty.AddOwner(); + + public bool IsTitleBarVisible + { + get => GetValue(IsTitleBarVisibleProperty); + set => SetValue(IsTitleBarVisibleProperty, value); + } + + public static readonly StyledProperty LeftContentProperty = + UrsaWindow.LeftContentProperty.AddOwner(); + + public object? LeftContent + { + get => GetValue(LeftContentProperty); + set => SetValue(LeftContentProperty, value); + } + + public static readonly StyledProperty RightContentProperty = + UrsaWindow.RightContentProperty.AddOwner(); + + public object? RightContent + { + get => GetValue(RightContentProperty); + set => SetValue(RightContentProperty, value); + } + + public static readonly StyledProperty TitleBarContentProperty = + UrsaWindow.TitleBarContentProperty.AddOwner(); + + public object? TitleBarContent + { + get => GetValue(TitleBarContentProperty); + set => SetValue(TitleBarContentProperty, value); + } + + public static readonly StyledProperty TitleBarMarginProperty = + UrsaWindow.TitleBarMarginProperty.AddOwner(); + + public Thickness TitleBarMargin + { + get => GetValue(TitleBarMarginProperty); + set => SetValue(TitleBarMarginProperty, value); + } +} \ No newline at end of file