mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 17:56:44 +02:00
* Updating run icon * Bookmark * System * WindowWalker * Extensions * CreateExtensions * Services * Replacing icon This PR updates the Segoe Fluent icons with colored Fluent icons. 
50 lines
1.4 KiB
C#
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);
|
|
}
|
|
}
|