feat: Add Banner
This commit is contained in:
@@ -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<NotificationType> _types;
|
||||
public ObservableCollection<NotificationType> 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>() { NotificationType.Information, NotificationType.Warning, NotificationType.Error, NotificationType.Success };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user