@@ -1177,37 +1177,40 @@ public void PopulateOmnibarSuggestionsForCommandPaletteMode()
11771177 OmnibarCommandPaletteModeText ??= string . Empty ;
11781178 OmnibarCommandPaletteModeSuggestionItems . Clear ( ) ;
11791179
1180- var dispatcherQueue = Microsoft . UI . Dispatching . DispatcherQueue . GetForCurrentThread ( ) ;
1181-
1182- dispatcherQueue . TryEnqueue ( ( ) =>
1180+ if ( ContentPageContext . SelectedItems . All ( x => ! x . IsFolder ) )
11831181 {
1184- var selectedItemPath = ContentPageContext . SelectedItem . ItemPath ;
1185- var fileActionEntity = ActionManager . Instance . EntityFactory . CreateFileEntity ( selectedItemPath ) ;
1186- var actions = ActionManager . Instance . ActionRuntime . ActionCatalog . GetActionsForInputs ( new [ ] { fileActionEntity } ) ;
1182+ var dispatcherQueue = Microsoft . UI . Dispatching . DispatcherQueue . GetForCurrentThread ( ) ;
11871183
1188- foreach ( var action in actions . Where ( a => a . Definition . Description . Contains ( OmnibarCommandPaletteModeText , StringComparison . OrdinalIgnoreCase ) ) )
1184+ dispatcherQueue . TryEnqueue ( ( ) =>
11891185 {
1190- var newItem = new NavigationBarSuggestionItem
1191- {
1192- PrimaryDisplay = action . Definition . Description ,
1193- SearchText = OmnibarCommandPaletteModeText ,
1194- ActionInstance = action
1195- } ;
1186+ var selectedItemPath = ContentPageContext . SelectedItem . ItemPath ;
1187+ var fileActionEntity = ActionManager . Instance . EntityFactory . CreateFileEntity ( selectedItemPath ) ;
1188+ var actions = ActionManager . Instance . ActionRuntime . ActionCatalog . GetActionsForInputs ( new [ ] { fileActionEntity } ) ;
11961189
1197- if ( Uri . TryCreate ( action . Definition . IconFullPath , UriKind . RelativeOrAbsolute , out Uri ? validUri ) )
1190+ foreach ( var action in actions . Where ( a => a . Definition . Description . Contains ( OmnibarCommandPaletteModeText , StringComparison . OrdinalIgnoreCase ) ) )
11981191 {
1199- try
1192+ var newItem = new NavigationBarSuggestionItem
12001193 {
1201- newItem . ActionIconSource = new BitmapImage ( validUri ) ;
1202- }
1203- catch ( Exception )
1194+ PrimaryDisplay = action . Definition . Description ,
1195+ SearchText = OmnibarCommandPaletteModeText ,
1196+ ActionInstance = action
1197+ } ;
1198+
1199+ if ( Uri . TryCreate ( action . Definition . IconFullPath , UriKind . RelativeOrAbsolute , out Uri ? validUri ) )
12041200 {
1201+ try
1202+ {
1203+ newItem . ActionIconSource = new BitmapImage ( validUri ) ;
1204+ }
1205+ catch ( Exception )
1206+ {
1207+ }
12051208 }
1206- }
12071209
1208- OmnibarCommandPaletteModeSuggestionItems . Add ( newItem ) ;
1209- }
1210- } ) ;
1210+ OmnibarCommandPaletteModeSuggestionItems . Add ( newItem ) ;
1211+ }
1212+ } ) ;
1213+ }
12111214
12121215 var suggestionItems = Commands
12131216 . Where ( command => command . IsExecutable
0 commit comments