Files
PowerToys/src/modules/cmdpal/Microsoft.CmdPal.UI.ViewModels/Commands/NewExtensionPage.cs
Niels Laute 69c2e9c568 [CmdPal] Adding colored extension icons (#38085)
* Updating run icon
* Bookmark
* System
* WindowWalker
* Extensions
* CreateExtensions
* Services
* Replacing icon

This PR updates the Segoe Fluent icons with colored Fluent icons.

![image](https://github.com/user-attachments/assets/8c1350a1-963b-4deb-9029-966ba0a3c0fb)
2025-03-24 03:01:33 -07:00

50 lines
1.4 KiB
C#

// 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 Microsoft.CommandPalette.Extensions;
using Microsoft.CommandPalette.Extensions.Toolkit;
namespace Microsoft.CmdPal.UI.ViewModels.BuiltinCommands;
public partial class NewExtensionPage : ContentPage
{
private NewExtensionForm _inputForm = new();
private NewExtensionFormBase? _resultForm;
public override IContent[] GetContent()
{
return _resultForm != null ? [_resultForm] : [_inputForm];
}
public NewExtensionPage()
{
Name = Properties.Resources.builtin_create_extension_name;
Title = Properties.Resources.builtin_create_extension_title;
Icon = IconHelpers.FromRelativePath("Assets\\CreateExtension.svg");
_inputForm.FormSubmitted += FormSubmitted;
}
private void FormSubmitted(NewExtensionFormBase sender, NewExtensionFormBase? args)
{
if (_resultForm != null)
{
_resultForm.FormSubmitted -= FormSubmitted;
}
_resultForm = args;
if (_resultForm != null)
{
_resultForm.FormSubmitted += FormSubmitted;
}
else
{
_inputForm = new();
_inputForm.FormSubmitted += FormSubmitted;
}
RaiseItemsChanged(1);
}
}