1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- using Avalonia;
- using Avalonia.Controls;
- using Avalonia.Controls.Primitives;
- using Avalonia.Markup.Xaml;
- using Avalonia.Media;
- using System.Windows.Input;
- namespace InABox.Avalonia.Components;
- public partial class ListViewButton : TemplatedControl
- {
- public static readonly StyledProperty<IImage?> ImageProperty =
- AvaloniaProperty.Register<ListViewButton, IImage?>(nameof(Image), null);
- public static readonly StyledProperty<string> TitleProperty =
- AvaloniaProperty.Register<ListViewButton, string>(nameof(Title), "");
- public static readonly StyledProperty<string> DescriptionProperty =
- AvaloniaProperty.Register<ListViewButton, string>(nameof(Description), "");
- public static readonly StyledProperty<string> AlertProperty =
- AvaloniaProperty.Register<ListViewButton, string>(nameof(Alert), "");
- public IImage? Image
- {
- get => GetValue(ImageProperty);
- set => SetValue(ImageProperty, value);
- }
- public string Title
- {
- get => GetValue(TitleProperty);
- set => SetValue(TitleProperty, value);
- }
- public string Description
- {
- get => GetValue(DescriptionProperty);
- set => SetValue(DescriptionProperty, value);
- }
- public string Alert
- {
- get => GetValue(AlertProperty);
- set => SetValue(AlertProperty, value);
- }
- public static readonly StyledProperty<object?> CommandParameterProperty =
- AvaloniaProperty.Register<ListViewButton, object?>(nameof(CommandParameter), null);
- public object? CommandParameter
- {
- get => GetValue(CommandParameterProperty);
- set => SetValue(CommandParameterProperty, value);
- }
- public static readonly StyledProperty<ICommand?> CommandProperty =
- AvaloniaProperty.Register<ListViewButton, ICommand?>(nameof(Command), null);
-
- public ICommand? Command
- {
- get => GetValue(CommandProperty);
- set => SetValue(CommandProperty, value);
- }
- }
|