Replace the sidebar + hero + single big-button layout with a flat list of per-version cards. Each card carries its own action button: - Installed: ▶ Lancer (green, primary) - Available on server only: ⬇ Installer (blue, accent) + lighter blue card - Busy: inline mini progress bar with %, card tinted green Each card also exposes a "..." menu (left-click opens it) with: - Voir les release notes (works for installed and remote-only versions) - Ouvrir le dossier (installed only) - Supprimer cette version (installed only, with confirmation dialog) VersionRowViewModel owns its state (InstalledIdle / AvailableIdle / Downloading / Installing / Uninstalling) and its commands; MainViewModel wires per-row handlers after instantiation so the row VM stays UI-only and the services live one layer up. ReleaseNotesViewerDialog: separate dialog reused by the menu — same Markdown rendering as UpdateAvailableDialog but no download CTA. Theme: AccentButton + IconButton + dark ContextMenu/MenuItem styles. Behavior changes: - The single global SelectedVersion + AvailableUpdate are gone; each row is independently actionable. - The list now merges installed + remote: a version present on the server but not locally appears as a "remote-only" row, and vice-versa. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
27 lines
684 B
C#
27 lines
684 B
C#
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Controls.Primitives;
|
|
|
|
namespace PSLauncher.App.Views;
|
|
|
|
public partial class MainWindow : Window
|
|
{
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
/// <summary>
|
|
/// Le bouton "..." ouvre son ContextMenu sur clic gauche (par défaut, ContextMenu ne s'ouvre qu'au clic droit).
|
|
/// </summary>
|
|
private void OnMoreMenuClick(object sender, RoutedEventArgs e)
|
|
{
|
|
if (sender is Button btn && btn.ContextMenu is { } menu)
|
|
{
|
|
menu.PlacementTarget = btn;
|
|
menu.Placement = PlacementMode.Bottom;
|
|
menu.IsOpen = true;
|
|
}
|
|
}
|
|
}
|