diff --git a/demo/Ursa.Demo/Pages/BannerDemo.axaml b/demo/Ursa.Demo/Pages/BannerDemo.axaml index b269c4c..e7b9630 100644 --- a/demo/Ursa.Demo/Pages/BannerDemo.axaml +++ b/demo/Ursa.Demo/Pages/BannerDemo.axaml @@ -4,32 +4,49 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:pages="clr-namespace:Ursa.Demo.Pages" xmlns:u="https://irihi.tech/ursa" - d:DesignHeight="450" - d:DesignWidth="800" mc:Ignorable="d"> + + + - - - - - - + + + + + + + + + + + + diff --git a/demo/Ursa.Demo/Pages/BannerDemo.axaml.cs b/demo/Ursa.Demo/Pages/BannerDemo.axaml.cs index 435968b..8ea8b76 100644 --- a/demo/Ursa.Demo/Pages/BannerDemo.axaml.cs +++ b/demo/Ursa.Demo/Pages/BannerDemo.axaml.cs @@ -1,6 +1,9 @@ +using System.Collections.ObjectModel; using Avalonia; using Avalonia.Controls; +using Avalonia.Controls.Notifications; using Avalonia.Markup.Xaml; +using Ursa.Demo.ViewModels; namespace Ursa.Demo.Pages; @@ -9,10 +12,37 @@ public partial class BannerDemo : UserControl public BannerDemo() { InitializeComponent(); + this.DataContext = new BannerDemoViewModel(); + } +} + +public class BannerDemoViewModel: ViewModelBase +{ + private ObservableCollection _types; + public ObservableCollection Types + { + get => _types; + set => SetProperty(ref _types, value); } - private void InitializeComponent() + private NotificationType _selectedType; + + public NotificationType SelectedType { - AvaloniaXamlLoader.Load(this); + get => _selectedType; + set => SetProperty(ref _selectedType, value); + } + + private bool _bordered; + + public bool Bordered + { + get => _bordered; + set => SetProperty(ref _bordered, value); + } + + public BannerDemoViewModel() + { + Types = new ObservableCollection() { NotificationType.Information, NotificationType.Warning, NotificationType.Error, NotificationType.Success }; } } \ No newline at end of file diff --git a/demo/Ursa.Demo/Ursa.Demo.csproj b/demo/Ursa.Demo/Ursa.Demo.csproj index 0df5a4d..272045d 100644 --- a/demo/Ursa.Demo/Ursa.Demo.csproj +++ b/demo/Ursa.Demo/Ursa.Demo.csproj @@ -23,6 +23,7 @@ + diff --git a/src/Ursa.Themes.Semi/Controls/Banner.axaml b/src/Ursa.Themes.Semi/Controls/Banner.axaml index 4d07cce..27f68b2 100644 --- a/src/Ursa.Themes.Semi/Controls/Banner.axaml +++ b/src/Ursa.Themes.Semi/Controls/Banner.axaml @@ -4,6 +4,8 @@ xmlns:u="https://irihi.tech/ursa"> + + @@ -23,6 +25,7 @@ Grid.Row="0" Grid.RowSpan="2" Grid.Column="0" + Margin="{DynamicResource BannerIconMargin}" VerticalAlignment="Top" IsVisible="{TemplateBinding ShowIcon}"> @@ -50,32 +53,70 @@ - + + + + + + + + + + diff --git a/src/Ursa.Themes.Semi/Themes/Light/Banner.axaml b/src/Ursa.Themes.Semi/Themes/Light/Banner.axaml index bb71aab..2fda7f5 100644 --- a/src/Ursa.Themes.Semi/Themes/Light/Banner.axaml +++ b/src/Ursa.Themes.Semi/Themes/Light/Banner.axaml @@ -2,4 +2,12 @@ + + + + + + + + diff --git a/src/Ursa.Themes.Semi/Themes/Shared/Banner.axaml b/src/Ursa.Themes.Semi/Themes/Shared/Banner.axaml index a62c46c..39a925c 100644 --- a/src/Ursa.Themes.Semi/Themes/Shared/Banner.axaml +++ b/src/Ursa.Themes.Semi/Themes/Shared/Banner.axaml @@ -8,4 +8,5 @@ 3 1 + 0 0 12 0 diff --git a/src/Ursa.Themes.Semi/Ursa.Themes.Semi.csproj b/src/Ursa.Themes.Semi/Ursa.Themes.Semi.csproj index ff62375..7fb04b2 100644 --- a/src/Ursa.Themes.Semi/Ursa.Themes.Semi.csproj +++ b/src/Ursa.Themes.Semi/Ursa.Themes.Semi.csproj @@ -9,7 +9,6 @@ -