diff --git a/samples/ControlCatalog/MainWindow.xaml b/samples/ControlCatalog/MainWindow.xaml index 935db20757..1f9702d107 100644 --- a/samples/ControlCatalog/MainWindow.xaml +++ b/samples/ControlCatalog/MainWindow.xaml @@ -9,68 +9,27 @@ xmlns:v="clr-namespace:ControlCatalog.Views" x:Class="ControlCatalog.MainWindow" WindowState="{Binding WindowState, Mode=TwoWay}"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/samples/ControlCatalog/MainWindow.xaml.cs b/samples/ControlCatalog/MainWindow.xaml.cs index d97325ef8d..e70c69eb3d 100644 --- a/samples/ControlCatalog/MainWindow.xaml.cs +++ b/samples/ControlCatalog/MainWindow.xaml.cs @@ -28,10 +28,7 @@ namespace ControlCatalog }; DataContext = new MainWindowViewModel(_notificationArea); - _recentMenu = ((NativeMenu.GetMenu(this).Items[0] as NativeMenuItem).Menu.Items[2] as NativeMenuItem).Menu; - - var mainMenu = this.FindControl("MainMenu"); - mainMenu.AttachedToVisualTree += MenuAttached; + } public static string MenuQuitHeader => RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? "Quit Avalonia" : "E_xit"; diff --git a/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs b/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs index 0257b4ce66..0336d7f68e 100644 --- a/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs +++ b/samples/ControlCatalog/ViewModels/MainWindowViewModel.cs @@ -1,3 +1,5 @@ +using System.Collections.Generic; +using System.Linq; using System.Reactive; using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; @@ -15,6 +17,9 @@ namespace ControlCatalog.ViewModels private WindowState _windowState; private WindowState[] _windowStates; + public List Albums { get; set; } = Enumerable.Range(0, 400).ToList(); + + public MainWindowViewModel(IManagedNotificationManager notificationManager) { _notificationManager = notificationManager;