mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
Fully initialize context menus when they change (#38998)
If we don't slow-initialize the whole menu when it changes, then we won't see that there's secondary (& more) commands. Tested this with the extension from [waaverecords/CmdPal.Ext.Spotify#4](https://github.com/waaverecords/CmdPal.Ext.Spotify/pull/4) Closes #38959 Also seemingly closes #38347 - seems that needed additional bumping of the `EmptyContent`'s
This commit is contained in:
@@ -29,6 +29,8 @@ public partial class CommandBarViewModel : ObservableObject,
|
||||
|
||||
field = value;
|
||||
SetSelectedItem(value);
|
||||
|
||||
OnPropertyChanged(nameof(SelectedItem));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +117,10 @@ public partial class CommandBarViewModel : ObservableObject,
|
||||
{
|
||||
ShouldShowContextMenu = false;
|
||||
}
|
||||
|
||||
OnPropertyChanged(nameof(HasSecondaryCommand));
|
||||
OnPropertyChanged(nameof(SecondaryCommand));
|
||||
OnPropertyChanged(nameof(ShouldShowContextMenu));
|
||||
}
|
||||
|
||||
// InvokeItemCommand is what this will be in Xaml due to source generator
|
||||
|
||||
Reference in New Issue
Block a user