diff --git a/src/modules/cmdpal/Microsoft.CmdPal.Core.ViewModels/CommandItemViewModel.cs b/src/modules/cmdpal/Microsoft.CmdPal.Core.ViewModels/CommandItemViewModel.cs index 247814e5e6..1861b53ef7 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.Core.ViewModels/CommandItemViewModel.cs +++ b/src/modules/cmdpal/Microsoft.CmdPal.Core.ViewModels/CommandItemViewModel.cs @@ -342,7 +342,7 @@ public partial class CommandItemViewModel : ExtensionObjectViewModel, ICommandBa var newContextMenu = more .Select(item => { - if (item is CommandContextItem contextItem) + if (item is ICommandContextItem contextItem) { return new CommandContextItemViewModel(contextItem, PageContext) as IContextItemViewModel; } diff --git a/src/modules/cmdpal/Microsoft.CmdPal.Core.ViewModels/ContentPageViewModel.cs b/src/modules/cmdpal/Microsoft.CmdPal.Core.ViewModels/ContentPageViewModel.cs index a6bd2bb302..7787916de5 100644 --- a/src/modules/cmdpal/Microsoft.CmdPal.Core.ViewModels/ContentPageViewModel.cs +++ b/src/modules/cmdpal/Microsoft.CmdPal.Core.ViewModels/ContentPageViewModel.cs @@ -113,7 +113,7 @@ public abstract partial class ContentPageViewModel : PageViewModel, ICommandBarC .ToList() .Select(item => { - if (item is CommandContextItem contextItem) + if (item is ICommandContextItem contextItem) { return new CommandContextItemViewModel(contextItem, PageContext); } @@ -172,7 +172,7 @@ public abstract partial class ContentPageViewModel : PageViewModel, ICommandBarC .ToList() .Select(item => { - if (item is CommandContextItem contextItem) + if (item is ICommandContextItem contextItem) { return new CommandContextItemViewModel(contextItem, PageContext) as IContextItemViewModel; }