diff --git a/samples/IntegrationTestApp/App.axaml b/samples/IntegrationTestApp/App.axaml index f23ce53dbe8..60a2c565426 100644 --- a/samples/IntegrationTestApp/App.axaml +++ b/samples/IntegrationTestApp/App.axaml @@ -9,10 +9,15 @@ - + - + diff --git a/samples/IntegrationTestApp/App.axaml.cs b/samples/IntegrationTestApp/App.axaml.cs index 59f1185e178..c55f5fb3920 100644 --- a/samples/IntegrationTestApp/App.axaml.cs +++ b/samples/IntegrationTestApp/App.axaml.cs @@ -4,18 +4,20 @@ using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Markup.Xaml; +using Avalonia.Media; using MiniMvvm; namespace IntegrationTestApp { public class App : Application { + private MainWindow? _mainWindow; + public App() { - ShowWindowCommand = MiniCommand.Create(() => + TrayIconCommand = MiniCommand.Create(name => { - var window = new Window() { Title = "TrayIcon demo window" }; - window.Show(); + _mainWindow!.Get(name).IsChecked = true; }); DataContext = this; } @@ -29,12 +31,12 @@ public override void OnFrameworkInitializationCompleted() { if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) { - desktop.MainWindow = new MainWindow(); + desktop.MainWindow = _mainWindow = new MainWindow(); } base.OnFrameworkInitializationCompleted(); } - public ICommand ShowWindowCommand { get; } + public ICommand TrayIconCommand { get; } } } diff --git a/samples/IntegrationTestApp/MainWindow.axaml b/samples/IntegrationTestApp/MainWindow.axaml index c70d6b7ca01..97ea1188a1c 100644 --- a/samples/IntegrationTestApp/MainWindow.axaml +++ b/samples/IntegrationTestApp/MainWindow.axaml @@ -93,6 +93,14 @@ + + + Tray Icon Clicked + Tray Icon Menu Clicked +