Fixed issue with primary/secondary commands (#40849)

Closes #40822

These are not the classes you are looking for.

Issue was we were comparing to classes rather than interfaces and WinRT
no likey.
This commit is contained in:
Michael Jolley
2025-07-28 18:26:32 -05:00
committed by GitHub
parent 4785af2425
commit c16cd4c96f
2 changed files with 3 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -113,7 +113,7 @@ public abstract partial class ContentPageViewModel : PageViewModel, ICommandBarC
.ToList()
.Select<IContextItem, IContextItemViewModel>(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;
}