45 lines
No EOL
1.2 KiB
C#
45 lines
No EOL
1.2 KiB
C#
using System.Windows.Input;
|
|
using Avalonia;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Input;
|
|
using Avalonia.Markup.Xaml;
|
|
|
|
namespace LANCommander.Launcher.Views.Components;
|
|
|
|
public partial class GenreCarouselButton : UserControl
|
|
{
|
|
public static readonly StyledProperty<ICommand?> CommandProperty =
|
|
AvaloniaProperty.Register<GenreCarouselButton, ICommand?>(nameof(Command));
|
|
|
|
public static readonly StyledProperty<object?> CommandParameterProperty =
|
|
AvaloniaProperty.Register<GenreCarouselButton, object?>(nameof(CommandParameter));
|
|
|
|
public ICommand? Command
|
|
{
|
|
get => GetValue(CommandProperty);
|
|
set => SetValue(CommandProperty, value);
|
|
}
|
|
|
|
public object? CommandParameter
|
|
{
|
|
get => GetValue(CommandParameterProperty);
|
|
set => SetValue(CommandParameterProperty, value);
|
|
}
|
|
|
|
public GenreCarouselButton()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
protected override void OnPointerEntered(PointerEventArgs e)
|
|
{
|
|
base.OnPointerEntered(e);
|
|
ZIndex = 100;
|
|
}
|
|
|
|
protected override void OnPointerExited(PointerEventArgs e)
|
|
{
|
|
base.OnPointerExited(e);
|
|
ZIndex = 0;
|
|
}
|
|
} |