@@ -77,10 +77,10 @@ public bool IsCurrentInstance
77
77
78
78
public bool IsColumnView => SlimContentPage is ColumnViewBrowser ;
79
79
80
- public ItemViewModel FilesystemViewModel { get ; private set ; } = null ;
80
+ public ItemViewModel FilesystemViewModel { get ; private set ; }
81
81
public CurrentInstanceViewModel InstanceViewModel { get ; }
82
- private BaseLayout contentPage = null ;
83
82
83
+ private BaseLayout contentPage ;
84
84
public BaseLayout ContentPage
85
85
{
86
86
get => contentPage ;
@@ -96,7 +96,6 @@ public BaseLayout ContentPage
96
96
}
97
97
98
98
private bool isPageMainPane ;
99
-
100
99
public bool IsPageMainPane
101
100
{
102
101
get => isPageMainPane ;
@@ -143,6 +142,13 @@ public ModernShellPage()
143
142
FilesystemHelpers = new FilesystemHelpers ( this , cancellationTokenSource . Token ) ;
144
143
storageHistoryHelpers = new StorageHistoryHelpers ( new StorageHistoryOperations ( this , cancellationTokenSource . Token ) ) ;
145
144
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
+
146
152
ToolbarViewModel . SearchBox . TextChanged += ModernShellPage_TextChanged ;
147
153
ToolbarViewModel . SearchBox . QuerySubmitted += ModernShellPage_QuerySubmitted ;
148
154
ToolbarViewModel . InstanceViewModel = InstanceViewModel ;
@@ -514,20 +520,29 @@ public NavigationParams NavParams
514
520
private void OnNavigationParamsChanged ( )
515
521
{
516
522
if ( string . IsNullOrEmpty ( NavParams ? . NavPath ) || NavParams . NavPath == "Home" . GetLocalizedResource ( ) )
523
+ {
517
524
ItemDisplayFrame . Navigate ( typeof ( WidgetsPage ) ,
518
525
new NavigationArguments ( )
519
526
{
520
527
NavPathParam = NavParams ? . NavPath ,
521
528
AssociatedTabInstance = this
522
529
} , new EntranceNavigationTransitionInfo ( ) ) ;
530
+ }
523
531
else
532
+ {
533
+ var isTagSearch = NavParams . NavPath . StartsWith ( "tag:" ) ;
534
+
524
535
ItemDisplayFrame . Navigate ( InstanceViewModel . FolderSettings . GetLayoutType ( NavParams . NavPath ) ,
525
536
new NavigationArguments ( )
526
537
{
527
538
NavPathParam = NavParams . NavPath ,
528
539
SelectItems = ! string . IsNullOrWhiteSpace ( NavParams ? . SelectItem ) ? new [ ] { NavParams . SelectItem } : null ,
540
+ IsSearchResultPage = isTagSearch ,
541
+ SearchPathParam = isTagSearch ? "Home" . GetLocalizedResource ( ) : null ,
542
+ SearchQuery = isTagSearch ? navParams . NavPath : null ,
529
543
AssociatedTabInstance = this
530
544
} ) ;
545
+ }
531
546
}
532
547
533
548
public static readonly DependencyProperty NavParamsProperty =
@@ -574,12 +589,6 @@ private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
574
589
575
590
private void Page_Loaded ( object sender , RoutedEventArgs e )
576
591
{
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 ;
583
592
OnNavigationParamsChanged ( ) ;
584
593
this . Loaded -= Page_Loaded ;
585
594
}
0 commit comments