@@ -1177,37 +1177,40 @@ public void PopulateOmnibarSuggestionsForCommandPaletteMode()
1177
1177
OmnibarCommandPaletteModeText ??= string . Empty ;
1178
1178
OmnibarCommandPaletteModeSuggestionItems . Clear ( ) ;
1179
1179
1180
- var dispatcherQueue = Microsoft . UI . Dispatching . DispatcherQueue . GetForCurrentThread ( ) ;
1181
-
1182
- dispatcherQueue . TryEnqueue ( ( ) =>
1180
+ if ( ContentPageContext . SelectedItems . All ( x => ! x . IsFolder ) )
1183
1181
{
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 ( ) ;
1187
1183
1188
- foreach ( var action in actions . Where ( a => a . Definition . Description . Contains ( OmnibarCommandPaletteModeText , StringComparison . OrdinalIgnoreCase ) ) )
1184
+ dispatcherQueue . TryEnqueue ( ( ) =>
1189
1185
{
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 } ) ;
1196
1189
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 ) ) )
1198
1191
{
1199
- try
1192
+ var newItem = new NavigationBarSuggestionItem
1200
1193
{
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 ) )
1204
1200
{
1201
+ try
1202
+ {
1203
+ newItem . ActionIconSource = new BitmapImage ( validUri ) ;
1204
+ }
1205
+ catch ( Exception )
1206
+ {
1207
+ }
1205
1208
}
1206
- }
1207
1209
1208
- OmnibarCommandPaletteModeSuggestionItems . Add ( newItem ) ;
1209
- }
1210
- } ) ;
1210
+ OmnibarCommandPaletteModeSuggestionItems . Add ( newItem ) ;
1211
+ }
1212
+ } ) ;
1213
+ }
1211
1214
1212
1215
var suggestionItems = Commands
1213
1216
. Where ( command => command . IsExecutable
0 commit comments