diff --git a/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/AppStateService.cs b/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/AppStateService.cs index f377aa8fb2..acd9b29119 100644 --- a/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/AppStateService.cs +++ b/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/AppStateService.cs @@ -18,7 +18,7 @@ public partial class AppStateService public AppStateModel CurrentSettings => _appStateModel; - public AppStateService(ILogger logger) + public AppStateService(ILogger logger) { this.logger = logger; _filePath = PersistenceService.SettingsJsonPath("state.json"); diff --git a/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/Extensions/BuiltInExtensionService.cs b/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/Extensions/BuiltInExtensionService.cs index f7062721ff..8a69949c3b 100644 --- a/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/Extensions/BuiltInExtensionService.cs +++ b/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/Extensions/BuiltInExtensionService.cs @@ -4,6 +4,6 @@ namespace Microsoft.CommandPalette.UI.Services.Extensions; -internal class BuiltInExtensionService : IExtensionService +public class BuiltInExtensionService : IExtensionService { } diff --git a/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/Extensions/IExtensionService.cs b/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/Extensions/IExtensionService.cs index 4ea9d89c55..e61a4f2737 100644 --- a/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/Extensions/IExtensionService.cs +++ b/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/Extensions/IExtensionService.cs @@ -4,6 +4,7 @@ namespace Microsoft.CommandPalette.UI.Services.Extensions; -internal interface IExtensionService +public interface IExtensionService { + CommandViewModel } diff --git a/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/Extensions/JsonRPCExtensionService.cs b/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/Extensions/JsonRPCExtensionService.cs new file mode 100644 index 0000000000..b6dd152025 --- /dev/null +++ b/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/Extensions/JsonRPCExtensionService.cs @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CommandPalette.UI.Services.Extensions; + +public class JsonRPCExtensionService : IExtensionService +{ +} diff --git a/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/Extensions/WinRTExtensionService.cs b/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/Extensions/WinRTExtensionService.cs index 4b3efc35e2..4064607c23 100644 --- a/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/Extensions/WinRTExtensionService.cs +++ b/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/Extensions/WinRTExtensionService.cs @@ -4,6 +4,6 @@ namespace Microsoft.CommandPalette.UI.Services.Extensions; -internal class WinRTExtensionService : IExtensionService +public class WinRTExtensionService : IExtensionService { } diff --git a/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/SettingsService.cs b/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/SettingsService.cs index 658b4a5c45..5725fd3867 100644 --- a/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/SettingsService.cs +++ b/src/modules/Deux/UI/Microsoft.CommandPalette.UI.Services/SettingsService.cs @@ -22,7 +22,7 @@ public partial class SettingsService public SettingsModel CurrentSettings => _settingsModel; - public SettingsService(ILogger logger) + public SettingsService(ILogger logger) { this.logger = logger; _filePath = PersistenceService.SettingsJsonPath("settings.json"); diff --git a/src/modules/Deux/UI/Microsoft.CommandPalette.UI.ViewModels/CommandViewModel.cs b/src/modules/Deux/UI/Microsoft.CommandPalette.UI.ViewModels/CommandViewModel.cs new file mode 100644 index 0000000000..827383b52c --- /dev/null +++ b/src/modules/Deux/UI/Microsoft.CommandPalette.UI.ViewModels/CommandViewModel.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using CommunityToolkit.Mvvm.ComponentModel; +using Microsoft.CommandPalette.Extensions; +using Microsoft.CommandPalette.Extensions.Toolkit; +using Windows.Foundation; + +namespace Microsoft.CmdPal.UI.ViewModels; + +public sealed partial class CommandViewModel : ObservableObject +{ + public string Title { get; set; } = string.Empty; + + public string Subtitle { get; set; } = string.Empty; + + public IIconInfo Icon { get; set; } + + public Details Details { get; set; } + + public event TypedEventHandler? PropChanged; + + public bool IsEnabled { get; set; } +} diff --git a/src/modules/Deux/UI/Microsoft.CommandPalette.UI/App.xaml.cs b/src/modules/Deux/UI/Microsoft.CommandPalette.UI/App.xaml.cs index ee34e74614..eccbdbf917 100644 --- a/src/modules/Deux/UI/Microsoft.CommandPalette.UI/App.xaml.cs +++ b/src/modules/Deux/UI/Microsoft.CommandPalette.UI/App.xaml.cs @@ -5,6 +5,7 @@ using Microsoft.CommandPalette.UI.Helpers; using Microsoft.CommandPalette.UI.Pages; using Microsoft.CommandPalette.UI.Services; +using Microsoft.CommandPalette.UI.Services.Extensions; using Microsoft.CommandPalette.ViewModels; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -31,7 +32,6 @@ public partial class App : Application public ETWTrace EtwTrace { get; private set; } = new ETWTrace(); - public App(ILogger logger) { this.logger = logger; @@ -70,6 +70,15 @@ public partial class App : Application services.AddSingleton(); services.AddSingleton(); + // Register extension services + // We do these before other services so that they are available + // during initialization of other services. Technically, they should + // be registered before other services require them, but this is + // a simple way to ensure that. + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + // Register services services.AddSingleton();