LANCommander/LANCommander.Launcher/Views/GameActionsOverlay.axaml.cs
Pat Hartl b183e4b18c Remove old launcher, rename Avalonia launcher
Also adds ARM builds for Linux + Windows launcher
2026-06-06 05:49:24 -05:00

33 lines
919 B
C#

using System;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Interactivity;
using LANCommander.Launcher.ViewModels.Components;
using ManifestAction = LANCommander.SDK.Models.Manifest.Action;
namespace LANCommander.Launcher.Views;
public partial class GameActionsOverlay : UserControl
{
public event EventHandler<ManifestAction?>? ActionSelected;
public GameActionsOverlay()
{
InitializeComponent();
}
private void Action_Click(object? sender, RoutedEventArgs e)
{
if (sender is Button { DataContext: GameActionViewModel vm })
Close(vm.Action);
}
private void Cancel_Click(object? sender, RoutedEventArgs e) => Close(null);
private void Close(ManifestAction? action)
{
var layer = OverlayLayer.GetOverlayLayer(this);
ActionSelected?.Invoke(this, action);
layer?.Children.Remove(this);
}
}