11using CommunityToolkit . Mvvm . DependencyInjection ;
2- using CommunityToolkit . Mvvm . Input ;
32using CommunityToolkit . WinUI . Helpers ;
43using CommunityToolkit . WinUI . UI ;
54using CommunityToolkit . WinUI . UI . Controls ;
2524using System . ComponentModel ;
2625using System . Runtime . CompilerServices ;
2726using System . Threading . Tasks ;
28- using System . Windows . Input ;
2927using UWPToWinAppSDKUpgradeHelpers ;
3028using Windows . ApplicationModel ;
3129using Windows . Services . Store ;
@@ -45,6 +43,8 @@ public sealed partial class MainPage : Page, INotifyPropertyChanged
4543 public ICommandManager Commands { get ; } = Ioc . Default . GetRequiredService < ICommandManager > ( ) ;
4644 public IWindowContext WindowContext { get ; } = Ioc . Default . GetRequiredService < IWindowContext > ( ) ;
4745
46+ public SidebarViewModel SidebarAdaptiveViewModel = Ioc . Default . GetRequiredService < SidebarViewModel > ( ) ;
47+
4848 public AppModel AppModel => App . AppModel ;
4949
5050 public MainPageViewModel ViewModel
@@ -53,20 +53,15 @@ public MainPageViewModel ViewModel
5353 set => DataContext = value ;
5454 }
5555
56-
5756 /// <summary>
5857 /// True if the user is currently resizing the preview pane
5958 /// </summary>
6059 private bool draggingPreviewPane ;
6160
6261 private bool keyReleased = true ;
6362
64- public SidebarViewModel SidebarAdaptiveViewModel = new SidebarViewModel ( ) ;
65-
6663 public readonly OngoingTasksViewModel OngoingTasksViewModel ;
6764
68- private ICommand ToggleSidebarCollapsedStateCommand => new RelayCommand < KeyboardAcceleratorInvokedEventArgs > ( x => ToggleSidebarCollapsedState ( x ) ) ;
69-
7065 public MainPage ( )
7166 {
7267 InitializeComponent ( ) ;
@@ -406,12 +401,6 @@ private void Page_SizeChanged(object sender, SizeChangedEventArgs e)
406401 }
407402 }
408403
409- private void ToggleSidebarCollapsedState ( KeyboardAcceleratorInvokedEventArgs ? e )
410- {
411- SidebarAdaptiveViewModel . IsSidebarOpen = ! SidebarAdaptiveViewModel . IsSidebarOpen ;
412- e ! . Handled = true ;
413- }
414-
415404 private void SidebarControl_Loaded ( object sender , RoutedEventArgs e )
416405 {
417406 SidebarAdaptiveViewModel . UpdateTabControlMargin ( ) ; // Set the correct tab margin on startup
0 commit comments