cleanup for review

This commit is contained in:
Mike Griese
2026-02-18 13:30:01 -06:00
parent 88ed8cc9bc
commit b326300537
4 changed files with 9 additions and 5 deletions

View File

@@ -231,8 +231,6 @@ public sealed class CommandProviderWrapper : ICommandProviderContext
var ourContext = GetProviderContext();
var makeAndAdd = (ICommandItem? i, bool fallback) =>
{
// n.b. Mike, you may want to revisit this after the dock stuff merges,
// because I think we'll need to pass a contextMenuFactory to dock items
CommandItemViewModel commandItemViewModel = new(new(i), pageContext, contextMenuFactory: contextMenuFactory);
TopLevelViewModel topLevelViewModel = new(commandItemViewModel, fallback, ExtensionHost, ourContext, settings, providerSettings, serviceProvider, i);
topLevelViewModel.InitializeProperties();

View File

@@ -7,6 +7,12 @@ using Microsoft.CmdPal.Core.ViewModels;
namespace Microsoft.CmdPal.UI.ViewModels;
/// <summary>
/// Used as the PageContext for top-level items. Top level items are displayed
/// on the MainListPage, which _we_ own. We need to have a placeholder page
/// context for each provider that still connects those top-level items to the
/// CommandProvider they came from.
/// </summary>
public partial class TopLevelItemPageContext : IPageContext
{
public TaskScheduler Scheduler { get; private set; }

View File

@@ -37,8 +37,8 @@ internal sealed partial class CommandPaletteContextMenuFactory : IContextMenuFac
page.ProviderContext.SupportsPinning &&
!string.IsNullOrEmpty(itemId))
{
// TODO: #45201 Here, we'll want to add pin/unpin commands for pinning
// items to the top-level or to the dock.
// Add pin/unpin commands for pinning items to the top-level or to
// the dock.
var providerId = page.ProviderContext.ProviderId;
if (_topLevelCommandManager.LookupProvider(providerId) is CommandProviderWrapper provider)
{

View File

@@ -1,4 +1,4 @@
eii<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(RepoRoot)src\Common.Dotnet.CsWinRT.props" />
<PropertyGroup>