70 lines
1.9 KiB
C#
70 lines
1.9 KiB
C#
using Avalonia;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Input;
|
|
using System.Windows.Input;
|
|
using LehrerApp.Desktop.ViewModels;
|
|
|
|
namespace LehrerApp.Desktop.Views;
|
|
|
|
public partial class NavButton : UserControl
|
|
{
|
|
public static readonly StyledProperty<string> IconProperty =
|
|
AvaloniaProperty.Register<NavButton, string>(nameof(Icon), "");
|
|
|
|
public static readonly StyledProperty<string> LabelProperty =
|
|
AvaloniaProperty.Register<NavButton, string>(nameof(Label), "");
|
|
|
|
public static readonly StyledProperty<NavItem> ItemProperty =
|
|
AvaloniaProperty.Register<NavButton, NavItem>(nameof(Item));
|
|
|
|
public static readonly StyledProperty<NavItem> ActiveItemProperty =
|
|
AvaloniaProperty.Register<NavButton, NavItem>(nameof(ActiveItem));
|
|
|
|
public static readonly StyledProperty<ICommand?> CommandProperty =
|
|
AvaloniaProperty.Register<NavButton, ICommand?>(nameof(Command));
|
|
|
|
public static readonly StyledProperty<object?> CommandParameterProperty =
|
|
AvaloniaProperty.Register<NavButton, object?>(nameof(CommandParameter));
|
|
|
|
public string Icon
|
|
{
|
|
get => GetValue(IconProperty);
|
|
set => SetValue(IconProperty, value);
|
|
}
|
|
|
|
public string Label
|
|
{
|
|
get => GetValue(LabelProperty);
|
|
set => SetValue(LabelProperty, value);
|
|
}
|
|
|
|
public NavItem Item
|
|
{
|
|
get => GetValue(ItemProperty);
|
|
set => SetValue(ItemProperty, value);
|
|
}
|
|
|
|
public NavItem ActiveItem
|
|
{
|
|
get => GetValue(ActiveItemProperty);
|
|
set => SetValue(ActiveItemProperty, value);
|
|
}
|
|
|
|
public ICommand? Command
|
|
{
|
|
get => GetValue(CommandProperty);
|
|
set => SetValue(CommandProperty, value);
|
|
}
|
|
|
|
public object? CommandParameter
|
|
{
|
|
get => GetValue(CommandParameterProperty);
|
|
set => SetValue(CommandParameterProperty, value);
|
|
}
|
|
|
|
public NavButton()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
}
|