@@ -77,10 +77,10 @@ public bool IsCurrentInstance
7777
7878 public bool IsColumnView => SlimContentPage is ColumnViewBrowser ;
7979
80- public ItemViewModel FilesystemViewModel { get ; private set ; } = null ;
80+ public ItemViewModel FilesystemViewModel { get ; private set ; }
8181 public CurrentInstanceViewModel InstanceViewModel { get ; }
82- private BaseLayout contentPage = null ;
8382
83+ private BaseLayout contentPage ;
8484 public BaseLayout ContentPage
8585 {
8686 get => contentPage ;
@@ -96,7 +96,6 @@ public BaseLayout ContentPage
9696 }
9797
9898 private bool isPageMainPane ;
99-
10099 public bool IsPageMainPane
101100 {
102101 get => isPageMainPane ;
@@ -143,6 +142,13 @@ public ModernShellPage()
143142 FilesystemHelpers = new FilesystemHelpers ( this , cancellationTokenSource . Token ) ;
144143 storageHistoryHelpers = new StorageHistoryHelpers ( new StorageHistoryOperations ( this , cancellationTokenSource . Token ) ) ;
145144
145+ FilesystemViewModel = new ItemViewModel ( InstanceViewModel . FolderSettings ) ;
146+ FilesystemViewModel . WorkingDirectoryModified += ViewModel_WorkingDirectoryModified ;
147+ FilesystemViewModel . ItemLoadStatusChanged += FilesystemViewModel_ItemLoadStatusChanged ;
148+ FilesystemViewModel . DirectoryInfoUpdated += FilesystemViewModel_DirectoryInfoUpdated ;
149+ FilesystemViewModel . PageTypeUpdated += FilesystemViewModel_PageTypeUpdated ;
150+ FilesystemViewModel . OnSelectionRequestedEvent += FilesystemViewModel_OnSelectionRequestedEvent ;
151+
146152 ToolbarViewModel . SearchBox . TextChanged += ModernShellPage_TextChanged ;
147153 ToolbarViewModel . SearchBox . QuerySubmitted += ModernShellPage_QuerySubmitted ;
148154 ToolbarViewModel . InstanceViewModel = InstanceViewModel ;
@@ -514,20 +520,29 @@ public NavigationParams NavParams
514520 private void OnNavigationParamsChanged ( )
515521 {
516522 if ( string . IsNullOrEmpty ( NavParams ? . NavPath ) || NavParams . NavPath == "Home" . GetLocalizedResource ( ) )
523+ {
517524 ItemDisplayFrame . Navigate ( typeof ( WidgetsPage ) ,
518525 new NavigationArguments ( )
519526 {
520527 NavPathParam = NavParams ? . NavPath ,
521528 AssociatedTabInstance = this
522529 } , new EntranceNavigationTransitionInfo ( ) ) ;
530+ }
523531 else
532+ {
533+ var isTagSearch = NavParams . NavPath . StartsWith ( "tag:" ) ;
534+
524535 ItemDisplayFrame . Navigate ( InstanceViewModel . FolderSettings . GetLayoutType ( NavParams . NavPath ) ,
525536 new NavigationArguments ( )
526537 {
527538 NavPathParam = NavParams . NavPath ,
528539 SelectItems = ! string . IsNullOrWhiteSpace ( NavParams ? . SelectItem ) ? new [ ] { NavParams . SelectItem } : null ,
540+ IsSearchResultPage = isTagSearch ,
541+ SearchPathParam = isTagSearch ? "Home" . GetLocalizedResource ( ) : null ,
542+ SearchQuery = isTagSearch ? navParams . NavPath : null ,
529543 AssociatedTabInstance = this
530544 } ) ;
545+ }
531546 }
532547
533548 public static readonly DependencyProperty NavParamsProperty =
@@ -574,12 +589,6 @@ private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
574589
575590 private void Page_Loaded ( object sender , RoutedEventArgs e )
576591 {
577- FilesystemViewModel = new ItemViewModel ( InstanceViewModel ? . FolderSettings ) ;
578- FilesystemViewModel . WorkingDirectoryModified += ViewModel_WorkingDirectoryModified ;
579- FilesystemViewModel . ItemLoadStatusChanged += FilesystemViewModel_ItemLoadStatusChanged ;
580- FilesystemViewModel . DirectoryInfoUpdated += FilesystemViewModel_DirectoryInfoUpdated ;
581- FilesystemViewModel . PageTypeUpdated += FilesystemViewModel_PageTypeUpdated ;
582- FilesystemViewModel . OnSelectionRequestedEvent += FilesystemViewModel_OnSelectionRequestedEvent ;
583592 OnNavigationParamsChanged ( ) ;
584593 this . Loaded -= Page_Loaded ;
585594 }
0 commit comments