File tree Expand file tree Collapse file tree 3 files changed +36
-2
lines changed
Expand file tree Collapse file tree 3 files changed +36
-2
lines changed Original file line number Diff line number Diff line change 3030 <converters : NullToVisibilityCollapsedConverter x : Key =" NullToVisibilityCollapsedConverter" />
3131 <converters1 : BoolNegationConverter x : Key =" BoolNegationConverter" />
3232 <converters : VisibilityInvertConverter x : Key =" VisibilityInvertConverter" />
33+ <converters1 : BoolToObjectConverter
34+ x:Key=" SearchSuggestionGlyphConverter"
35+ FalseValue="  "
36+ TrueValue="  " />
3337
3438 <ResourceDictionary .MergedDictionaries>
3539 <ResourceDictionary Source =" ms-appx:///UserControls/KeyboardShortcut/KeyboardShortcut.xaml" />
Original file line number Diff line number Diff line change @@ -338,6 +338,7 @@ await DispatcherQueue.EnqueueOrInvokeAsync(() =>
338338 }
339339 else if ( Omnibar . CurrentSelectedMode == OmnibarSearchMode )
340340 {
341+ await ViewModel . PopulateOmnibarSuggestionsForSearchMode ( ) ;
341342 }
342343 }
343344
@@ -456,7 +457,7 @@ await DispatcherQueue.EnqueueOrInvokeAsync(() =>
456457 }
457458 else if ( e . NewMode == OmnibarSearchMode )
458459 {
459-
460+ await ViewModel . PopulateOmnibarSuggestionsForSearchMode ( ) ;
460461 }
461462 }
462463
@@ -486,7 +487,7 @@ await DispatcherQueue.EnqueueOrInvokeAsync(() =>
486487 }
487488 else if ( Omnibar . CurrentSelectedMode == OmnibarSearchMode )
488489 {
489-
490+ await ViewModel . PopulateOmnibarSuggestionsForSearchMode ( ) ;
490491 }
491492 }
492493 }
Original file line number Diff line number Diff line change @@ -1243,6 +1243,35 @@ public void PopulateOmnibarSuggestionsForCommandPaletteMode()
12431243 }
12441244 }
12451245
1246+ public async Task PopulateOmnibarSuggestionsForSearchMode ( )
1247+ {
1248+ OmnibarSearchModeSuggestionItems . Clear ( ) ;
1249+
1250+ if ( ContentPageContext . ShellPage is null )
1251+ return ;
1252+
1253+ if ( ! string . IsNullOrWhiteSpace ( OmnibarSearchModeText ) )
1254+ {
1255+ var search = new FolderSearch ( )
1256+ {
1257+ Query = OmnibarSearchModeText ,
1258+ Folder = ContentPageContext . ShellPage . ShellViewModel . WorkingDirectory ,
1259+ MaxItemCount = 10 ,
1260+ } ;
1261+
1262+ foreach ( var item in await search . SearchAsync ( ) )
1263+ {
1264+ var suggestion = new SuggestionModel ( item ) ;
1265+ if ( ! OmnibarSearchModeSuggestionItems . Any ( s => s . ItemPath == suggestion . ItemPath ) )
1266+ OmnibarSearchModeSuggestionItems . Add ( suggestion ) ;
1267+ }
1268+ }
1269+ else
1270+ {
1271+ // NOTE: Add to the recent queries
1272+ }
1273+ }
1274+
12461275 [ Obsolete ( "Remove once Omnibar goes out of experimental." ) ]
12471276 public async Task SetAddressBarSuggestionsAsync ( AutoSuggestBox sender , IShellPage shellpage )
12481277 {
You can’t perform that action at this time.
0 commit comments