Move builtins into sane places (#22)

Gets rid of the `AllApps.csproj` and `Calculator.csproj`
Makes the namespaces a bit more consistent

The sln now looks like
![image](https://github.com/user-attachments/assets/e8cd4bfa-ae83-4c02-acd8-05550262ff67)


with the "sample" extensions here
![image](https://github.com/user-attachments/assets/edf4b47b-012e-46a4-80b6-5e16e7643e02)
to better differentiate between built-in ones and the sample ones

@crutkas as an FYI because I know this was driving him mad
This commit is contained in:
Mike Griese
2024-09-03 12:42:14 -05:00
committed by GitHub
parent a8d69fa45b
commit a6e29784be
58 changed files with 111 additions and 163 deletions

View File

@@ -4,11 +4,7 @@ VisualStudioVersion = 17.11.34929.205
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CmdPal.UI.Poc", "src\WindowsCommandPalette\Microsoft.CmdPal.UI.Poc.csproj", "{F71CF22B-A5C7-4328-A5B3-F4191AE57314}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Calculator", "src\Plugins\Calculator\Calculator.csproj", "{C668A4BF-8BC1-48D1-B00D-FF99D05E6739}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AllApps", "src\Plugins\AllApps\AllApps.csproj", "{F5E5B8B9-7F51-43B8-ACED-1BD380BED98D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Plugins", "Plugins", "{B7FF739F-7716-4FC3-B622-705486187B87}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample Plugins", "Sample Plugins", "{B7FF739F-7716-4FC3-B622-705486187B87}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Terminal.UI", "src\Microsoft.Terminal.UI\Microsoft.Terminal.UI.vcxproj", "{6515F03F-E56D-4DB4-B23D-AC4FB80DB36F}"
EndProject
@@ -28,6 +24,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediaControlsExtension", "e
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProcessMonitorExtension", "extensions\ProcessMonitorExtension\ProcessMonitorExtension.csproj", "{9456257A-3292-4A8D-AF63-9830EABE7ED2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Prototype", "Prototype", "{B4B13D2C-8C19-43D0-9FD4-3084F42EA4C2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
@@ -48,22 +46,6 @@ Global
{F71CF22B-A5C7-4328-A5B3-F4191AE57314}.Release|x64.ActiveCfg = Release|x64
{F71CF22B-A5C7-4328-A5B3-F4191AE57314}.Release|x64.Build.0 = Release|x64
{F71CF22B-A5C7-4328-A5B3-F4191AE57314}.Release|x64.Deploy.0 = Release|x64
{C668A4BF-8BC1-48D1-B00D-FF99D05E6739}.Debug|ARM64.ActiveCfg = Debug|ARM64
{C668A4BF-8BC1-48D1-B00D-FF99D05E6739}.Debug|ARM64.Build.0 = Debug|ARM64
{C668A4BF-8BC1-48D1-B00D-FF99D05E6739}.Debug|x64.ActiveCfg = Debug|x64
{C668A4BF-8BC1-48D1-B00D-FF99D05E6739}.Debug|x64.Build.0 = Debug|x64
{C668A4BF-8BC1-48D1-B00D-FF99D05E6739}.Release|ARM64.ActiveCfg = Release|ARM64
{C668A4BF-8BC1-48D1-B00D-FF99D05E6739}.Release|ARM64.Build.0 = Release|ARM64
{C668A4BF-8BC1-48D1-B00D-FF99D05E6739}.Release|x64.ActiveCfg = Release|x64
{C668A4BF-8BC1-48D1-B00D-FF99D05E6739}.Release|x64.Build.0 = Release|x64
{F5E5B8B9-7F51-43B8-ACED-1BD380BED98D}.Debug|ARM64.ActiveCfg = Debug|ARM64
{F5E5B8B9-7F51-43B8-ACED-1BD380BED98D}.Debug|ARM64.Build.0 = Debug|ARM64
{F5E5B8B9-7F51-43B8-ACED-1BD380BED98D}.Debug|x64.ActiveCfg = Debug|x64
{F5E5B8B9-7F51-43B8-ACED-1BD380BED98D}.Debug|x64.Build.0 = Debug|x64
{F5E5B8B9-7F51-43B8-ACED-1BD380BED98D}.Release|ARM64.ActiveCfg = Release|ARM64
{F5E5B8B9-7F51-43B8-ACED-1BD380BED98D}.Release|ARM64.Build.0 = Release|ARM64
{F5E5B8B9-7F51-43B8-ACED-1BD380BED98D}.Release|x64.ActiveCfg = Release|x64
{F5E5B8B9-7F51-43B8-ACED-1BD380BED98D}.Release|x64.Build.0 = Release|x64
{6515F03F-E56D-4DB4-B23D-AC4FB80DB36F}.Debug|ARM64.ActiveCfg = Debug|ARM64
{6515F03F-E56D-4DB4-B23D-AC4FB80DB36F}.Debug|ARM64.Build.0 = Debug|ARM64
{6515F03F-E56D-4DB4-B23D-AC4FB80DB36F}.Debug|x64.ActiveCfg = Debug|x64
@@ -137,10 +119,11 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{C668A4BF-8BC1-48D1-B00D-FF99D05E6739} = {B7FF739F-7716-4FC3-B622-705486187B87}
{F5E5B8B9-7F51-43B8-ACED-1BD380BED98D} = {B7FF739F-7716-4FC3-B622-705486187B87}
{F71CF22B-A5C7-4328-A5B3-F4191AE57314} = {B4B13D2C-8C19-43D0-9FD4-3084F42EA4C2}
{6515F03F-E56D-4DB4-B23D-AC4FB80DB36F} = {B4B13D2C-8C19-43D0-9FD4-3084F42EA4C2}
{305DD37E-C85D-4B08-AAFE-7381FA890463} = {FAA24D36-5515-467C-91E7-101A189AAF48}
{79060D06-7174-4D66-8D0B-4FF021154049} = {FAA24D36-5515-467C-91E7-101A189AAF48}
{05CDE6EE-23AE-42AF-A9F5-E398C382675F} = {B4B13D2C-8C19-43D0-9FD4-3084F42EA4C2}
{57617906-DEC8-4D62-A270-6EBE3F8E5C0D} = {B7FF739F-7716-4FC3-B622-705486187B87}
{1A506BBA-06A9-476E-B5D3-1495F299D53F} = {B7FF739F-7716-4FC3-B622-705486187B87}
{D08AE85F-B6FE-4E1C-8402-DB396B70D6DA} = {B7FF739F-7716-4FC3-B622-705486187B87}

View File

@@ -1,20 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\..\Common.Dotnet.CsWinRT.props" />
<PropertyGroup>
<RootNamespace>AllApps</RootNamespace>
<UseWinUI>true</UseWinUI>
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.IO.Abstractions" />
<PackageReference Include="Microsoft.Windows.CsWin32">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\extensionsdk\Microsoft.Windows.CommandPalette.Extensions.Helpers\Microsoft.CmdPal.Extensions.Helpers.csproj" />
</ItemGroup>
</Project>

View File

@@ -1,2 +0,0 @@
SHCreateStreamOnFileEx
SHLoadIndirectString

View File

@@ -1,11 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\..\Common.Dotnet.CsWinRT.props" />
<PropertyGroup>
<RootNamespace>Calculator</RootNamespace>
<UseWinUI>true</UseWinUI>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\extensionsdk\Microsoft.Windows.CommandPalette.Extensions.Helpers\Microsoft.CmdPal.Extensions.Helpers.csproj" />
</ItemGroup>
</Project>

View File

@@ -2,17 +2,16 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using Windows.Foundation;
using Microsoft.Windows.CommandPalette.Extensions;
using Windows.System;
using System.Text.RegularExpressions;
using Microsoft.Windows.CommandPalette.Extensions.Helpers;
using System.Text.Json.Nodes;
using System.Text.Json;
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using Microsoft.Bot.AdaptiveExpressions.Core;
using Microsoft.Windows.CommandPalette.Extensions;
using Microsoft.Windows.CommandPalette.Extensions.Helpers;
using Windows.Foundation;
using Windows.System;
namespace Run.Bookmarks;

View File

@@ -4,11 +4,11 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.Windows.CommandPalette.Extensions;
using AllApps.Programs;
using Microsoft.Windows.CommandPalette.Extensions;
using Microsoft.Windows.CommandPalette.Extensions.Helpers;
namespace AllApps;
namespace WindowsCommandPalette.BuiltinCommands.AllApps;
public sealed class AllAppsPage : ListPage
{

View File

@@ -2,12 +2,12 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Diagnostics;
using System.Threading.Tasks;
using AllApps.Programs;
using System.Diagnostics;
using Microsoft.Windows.CommandPalette.Extensions.Helpers;
namespace AllApps;
namespace WindowsCommandPalette.BuiltinCommands.AllApps;
internal sealed class AppAction : InvokableCommand
{

View File

@@ -2,15 +2,13 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using AllApps.Programs;
namespace AllApps;
namespace WindowsCommandPalette.BuiltinCommands.AllApps;
public sealed class AppCache
{
internal IList<Win32Program> Win32s = AllApps.Programs.Win32Program.All();
internal IList<UWPApplication> UWPs = Programs.UWP.All();
internal IList<Win32Program> Win32s = Win32Program.All();
internal IList<UWPApplication> UWPs = UWP.All();
public static readonly Lazy<AppCache> Instance = new(() => new());
}

View File

@@ -2,7 +2,7 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace AllApps;
namespace WindowsCommandPalette.BuiltinCommands.AllApps;
internal sealed class AppItem
{

View File

@@ -4,7 +4,7 @@
using Microsoft.Windows.CommandPalette.Extensions.Helpers;
namespace AllApps;
namespace WindowsCommandPalette.BuiltinCommands.AllApps;
internal sealed class AppListItem : ListItem
{

View File

@@ -5,7 +5,7 @@
using System.Diagnostics;
using System.IO.Abstractions;
namespace AllApps;
namespace WindowsCommandPalette.BuiltinCommands.AllApps;
public class FileVersionInfoWrapper : IFileVersionInfoWrapper
{
@@ -34,4 +34,4 @@ public class FileVersionInfoWrapper : IFileVersionInfoWrapper
}
public string FileDescription { get; set; }
}
}

View File

@@ -4,11 +4,11 @@
using System.Diagnostics;
namespace AllApps;
namespace WindowsCommandPalette.BuiltinCommands.AllApps;
public interface IFileVersionInfoWrapper
{
FileVersionInfo GetVersionInfo(string path);
string FileDescription { get; set; }
}
}

View File

@@ -2,11 +2,11 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.Threading.Tasks;
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.Windows.CommandPalette.Extensions.Helpers;
namespace AllApps;
namespace WindowsCommandPalette.BuiltinCommands.AllApps;
// NOTE this is pretty close to what we'd put in the SDK
internal sealed class OpenPathAction(string target) : InvokableCommand
@@ -24,4 +24,4 @@ internal sealed class OpenPathAction(string target) : InvokableCommand
LaunchTarget(this._Target).Start();
return ActionResult.GoHome();
}
}
}

View File

@@ -2,7 +2,7 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace AllApps;
namespace WindowsCommandPalette.BuiltinCommands.AllApps;
public interface IShellLinkHelper
{
@@ -13,4 +13,4 @@ public interface IShellLinkHelper
string Arguments { get; set; }
bool HasArguments { get; set; }
}
}

View File

@@ -9,7 +9,7 @@ using System.Text;
//using Accessibility;
//using Wox.Plugin.Logger;
namespace AllApps;
namespace WindowsCommandPalette.BuiltinCommands.AllApps;
public class ShellLinkHelper : IShellLinkHelper
{
@@ -187,4 +187,4 @@ public class ShellLinkHelper : IShellLinkHelper
return target;
}
}
}

View File

@@ -2,15 +2,12 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Security;
// using Microsoft.Plugin.Program.Logger;
// using Microsoft.Plugin.Program.Utils;
using Microsoft.Win32;
using WindowsCommandPalette.BuiltinCommands.AllApps;
// using Wox.Plugin;
// using Wox.Plugin.Logger;
// using DirectoryWrapper = Wox.Infrastructure.FileSystemHelper.DirectoryWrapper;

View File

@@ -2,17 +2,17 @@
// 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.Windows.CommandPalette.Extensions;
using Microsoft.Windows.CommandPalette.Extensions.Helpers;
using System.Text.Json.Nodes;
using Microsoft.UI.Xaml;
using Microsoft.CmdPal.Common.Contracts;
using Microsoft.CmdPal.Common.Extensions;
using Microsoft.UI.Xaml;
using Microsoft.Windows.CommandPalette.Extensions;
using Microsoft.Windows.CommandPalette.Extensions.Helpers;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace Run.Settings;
namespace WindowsCommandPalette.Builtins;
internal sealed class SettingsPage : FormPage
{
@@ -22,18 +22,18 @@ internal sealed class SettingsPage : FormPage
public SettingsPage()
{
this.Icon = new("\uE713");
this.Name = "Settings";
Icon = new("\uE713");
Name = "Settings";
}
}
internal sealed class SettingsForm: Form
internal sealed class SettingsForm : Form
{
public SettingsForm()
{
}
public override string TemplateJson()
public override string TemplateJson()
{
var json = $$"""
{
@@ -105,7 +105,8 @@ internal sealed class SettingsForm: Form
public override ActionResult SubmitForm(string payload)
{
var formInput = JsonNode.Parse(payload)?.AsObject();
if (formInput == null) {
if (formInput == null)
{
return ActionResult.GoHome();
}
Application.Current.GetService<ILocalSettingsService>().SaveSettingAsync("GlobalHotkey", formInput["hotkey"]?.ToString() ?? string.Empty);
@@ -133,7 +134,7 @@ public class SettingsActionProvider : ICommandProvider
public IListItem[] TopLevelCommands()
{
return [ new ListItem(settingsPage) { Subtitle = "CmdPal settings"} ];
return [new ListItem(settingsPage) { Subtitle = "CmdPal settings" }];
}
}

View File

@@ -4,9 +4,12 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Microsoft.Terminal.UI;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
@@ -18,9 +21,6 @@ using Microsoft.Windows.CommandPalette.Extensions;
using Windows.ApplicationModel.AppExtensions;
using Windows.Foundation;
using Windows.Foundation.Collections;
using System.Collections.ObjectModel;
using Microsoft.Terminal.UI;
using System.ComponentModel;
namespace DeveloperCommandPalette;

View File

@@ -2,12 +2,13 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System.ComponentModel;
using System.Runtime.InteropServices;
using CmdPal.Models;
using Microsoft.UI.Dispatching;
using Microsoft.UI.Xaml.Controls;
using Microsoft.Windows.CommandPalette.Extensions;
using System.ComponentModel;
using Microsoft.UI.Dispatching;
using CmdPal.Models;
using System.Runtime.InteropServices;
using WindowsCommandPalette.Views;
namespace DeveloperCommandPalette;

View File

@@ -2,8 +2,8 @@
// 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.Windows.CommandPalette.Extensions.Helpers;
using Microsoft.Windows.CommandPalette.Extensions;
using Microsoft.Windows.CommandPalette.Extensions.Helpers;
using Windows.Foundation;
namespace DeveloperCommandPalette;

View File

@@ -10,6 +10,7 @@ using Microsoft.UI.Dispatching;
using Microsoft.UI.Xaml;
using Microsoft.Windows.CommandPalette.Extensions;
using Microsoft.Windows.CommandPalette.Extensions.Helpers;
using WindowsCommandPalette.Views;
namespace DeveloperCommandPalette;

View File

@@ -4,6 +4,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:DeveloperCommandPalette"
xmlns:cmdpal="using:WindowsCommandPalette.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Closed="MainWindow_Closed"
@@ -47,7 +48,7 @@
</StackPanel>
</Grid>
<Grid x:Name="ContentGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Padding="24,24,24,4" Grid.Row="1">
<local:MainPage x:Name="MainPage"/>
<cmdpal:MainPage x:Name="MainPage"/>
</Grid>
</Grid>
</Window>

View File

@@ -2,22 +2,23 @@
// 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.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Windows.Foundation;
using Windows.ApplicationModel;
using Microsoft.UI.Windowing;
using Microsoft.UI.Input;
using System.Runtime.InteropServices;
using Windows.Win32.Foundation;
using Microsoft.Win32;
using Windows.Graphics;
using System.Text.RegularExpressions;
using Microsoft.CmdPal.Common.Contracts;
using Microsoft.CmdPal.Common.Extensions;
using System.Text.RegularExpressions;
using Windows.System;
using Windows.Win32.UI.WindowsAndMessaging;
using Microsoft.CmdPal.Common.Services;
using Microsoft.UI.Input;
using Microsoft.UI.Windowing;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Media;
using Microsoft.Win32;
using Windows.ApplicationModel;
using Windows.Foundation;
using Windows.Graphics;
using Windows.System;
using Windows.Win32.Foundation;
using Windows.Win32.UI.WindowsAndMessaging;
using WindowsCommandPalette.Views;
namespace DeveloperCommandPalette;

View File

@@ -52,6 +52,7 @@
<PackageReference Include="System.Net.Http" />
<PackageReference Include="System.Private.Uri" />
<PackageReference Include="System.Text.RegularExpressions" />
<PackageReference Include="System.IO.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Hosting" />
<PackageReference Include="System.Text.Json" />
@@ -68,8 +69,6 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\extensionsdk\Microsoft.Windows.CommandPalette.Extensions.Helpers\Microsoft.CmdPal.Extensions.Helpers.csproj" />
<ProjectReference Include="..\Plugins\AllApps\AllApps.csproj" />
<ProjectReference Include="..\Plugins\Calculator\Calculator.csproj" />
<ProjectReference Include="..\Microsoft.CmdPal.Common\Microsoft.CmdPal.Common.csproj" />
<ProjectReference Include="..\Microsoft.Terminal.UI\Microsoft.Terminal.UI.vcxproj">
<ReferenceOutputAssembly>True</ReferenceOutputAssembly>
@@ -99,6 +98,9 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Folder Include="Views\" />
</ItemGroup>
<Target Name="CopyAdaptiveCardsToTargetDir" BeforeTargets="BeforeBuild">
<Message text="PkgAdaptiveCards_ObjectModel_WinUI3 = '$(PkgAdaptiveCards_ObjectModel_WinUI3)'" Importance="high" />
<Message text="PkgAdaptiveCards_Rendering_WinUI3 = '$(PkgAdaptiveCards_Rendering_WinUI3)'" Importance="high" />

View File

@@ -15,3 +15,5 @@ MonitorFromWindow
GetMonitorInfo
SHCreateStreamOnFileEx
CoAllowSetForegroundWindow
SHCreateStreamOnFileEx
SHLoadIndirectString

View File

@@ -4,9 +4,12 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Microsoft.Terminal.UI;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
@@ -18,9 +21,6 @@ using Microsoft.Windows.CommandPalette.Extensions;
using Windows.ApplicationModel.AppExtensions;
using Windows.Foundation;
using Windows.Foundation.Collections;
using System.Collections.ObjectModel;
using Microsoft.Terminal.UI;
using System.ComponentModel;
using Windows.UI;
namespace DeveloperCommandPalette;

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<UserControl
x:Class="DeveloperCommandPalette.DetailsControl"
x:Class="WindowsCommandPalette.Views.DetailsControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:DeveloperCommandPalette"
xmlns:local="using:WindowsCommandPalette.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="using:CommunityToolkit.WinUI.UI.Controls"

View File

@@ -2,25 +2,12 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using Microsoft.Windows.CommandPalette.Extensions;
using Windows.Foundation;
using Windows.Foundation.Collections;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace DeveloperCommandPalette;
namespace WindowsCommandPalette.Views;
public sealed class DetailsViewModel
{

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<Page
x:Class="DeveloperCommandPalette.FormPage"
x:Class="WindowsCommandPalette.Views.FormPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:DeveloperCommandPalette"
xmlns:local="using:WindowsCommandPalette.Views"
xmlns:ac="using:AdaptiveCards.Rendering.WinUI3"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

View File

@@ -8,6 +8,7 @@ using System.ComponentModel;
using AdaptiveCards.ObjectModel.WinUI3;
using AdaptiveCards.Rendering.WinUI3;
using AdaptiveCards.Templating;
using DeveloperCommandPalette;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Input;
@@ -17,7 +18,7 @@ using Windows.Foundation;
using Windows.System;
using Windows.UI.ViewManagement;
namespace DeveloperCommandPalette;
namespace WindowsCommandPalette.Views;
public sealed class FormViewModel : System.ComponentModel.INotifyPropertyChanged
{

View File

@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Page
x:Class="DeveloperCommandPalette.ListPage"
x:Class="WindowsCommandPalette.Views.ListPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:DeveloperCommandPalette"
xmlns:devpal="using:DeveloperCommandPalette"
xmlns:local="using:WindowsCommandPalette.Views"
xmlns:rsdk="using:Microsoft.Windows.CommandPalette.Extensions"
xmlns:mtu="using:Microsoft.Terminal.UI"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@@ -20,7 +21,7 @@
<StackLayout x:Name="HorizontalStackLayout" Orientation="Horizontal" Spacing="8"/>
<DataTemplate x:Key="TagTemplate" x:DataType="local:TagViewModel">
<DataTemplate x:Key="TagTemplate" x:DataType="devpal:TagViewModel">
<Border BorderBrush="{x:Bind BorderBrush, Mode=OneWay}"
BorderThickness="1"
CornerRadius="4"
@@ -39,7 +40,7 @@
</DataTemplate>
<!--Template for items in the main list view -->
<DataTemplate x:Key="ListItemTemplate" x:DataType="local:ListItemViewModel">
<DataTemplate x:Key="ListItemTemplate" x:DataType="devpal:ListItemViewModel">
<ListViewItem KeyDown="ListItem_KeyDown"
Tapped="ListItem_Tapped"
MinHeight="32"
@@ -79,7 +80,7 @@
</DataTemplate>
<!--Template for actions in the mode actions dropdown button -->
<DataTemplate x:Key="ContextMenuViewModelTemplate" x:DataType="local:ContextItemViewModel">
<DataTemplate x:Key="ContextMenuViewModelTemplate" x:DataType="devpal:ContextItemViewModel">
<ListViewItem KeyDown="ActionListViewItem_KeyDown" Tapped="ActionListViewItem_Tapped">
<Grid>
<Grid.ColumnDefinitions>

View File

@@ -5,6 +5,8 @@
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Runtime.InteropServices;
using DeveloperCommandPalette;
using Microsoft.UI.Dispatching;
using Microsoft.UI.Input;
using Microsoft.UI.Xaml;
@@ -13,11 +15,10 @@ using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Navigation;
using Microsoft.Windows.CommandPalette.Extensions.Helpers;
using Microsoft.Windows.CommandPalette.Extensions;
using System.Runtime.InteropServices;
using Microsoft.Windows.CommandPalette.Extensions.Helpers;
namespace DeveloperCommandPalette;
namespace WindowsCommandPalette.Views;
public sealed class StringNotEmptyToVisibilityConverter : IValueConverter
{

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Page
x:Class="DeveloperCommandPalette.MainPage"
x:Class="WindowsCommandPalette.Views.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:DeveloperCommandPalette"
xmlns:local="using:WindowsCommandPalette.Views"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"

View File

@@ -6,6 +6,7 @@ using System.Collections.ObjectModel;
using System.Runtime.InteropServices;
using System.Runtime.InteropServices.WindowsRuntime;
using CmdPal.Models;
using DeveloperCommandPalette;
using Microsoft.CmdPal.Common.Extensions;
using Microsoft.CmdPal.Common.Services;
using Microsoft.UI.Xaml;
@@ -17,12 +18,14 @@ using Microsoft.Windows.CommandPalette.Extensions.Helpers;
using Windows.Foundation;
using Windows.Win32;
using WindowsCommandPalette.BuiltinCommands;
using WindowsCommandPalette.BuiltinCommands.AllApps;
using WindowsCommandPalette.Builtins;
namespace DeveloperCommandPalette;
namespace WindowsCommandPalette.Views;
public sealed class MainViewModel
{
internal readonly AllApps.AllAppsPage apps = new();
internal readonly AllAppsPage apps = new();
internal readonly QuitActionProvider quitActionProvider = new();
internal readonly ReloadExtensionsActionProvider reloadActionProvider = new();
@@ -47,7 +50,7 @@ public sealed class MainViewModel
{
_builtInCommands.Add(new Run.Bookmarks.BookmarksActionProvider());
_builtInCommands.Add(new Calculator.CalculatorActionProvider());
_builtInCommands.Add(new Run.Settings.SettingsActionProvider());
_builtInCommands.Add(new SettingsActionProvider());
_builtInCommands.Add(quitActionProvider);
_builtInCommands.Add(reloadActionProvider);
@@ -56,7 +59,7 @@ public sealed class MainViewModel
// On a background thread, warm up the app cache since we want it more often than not
new Task(() =>
{
var _ = AllApps.AppCache.Instance.Value;
var _ = AppCache.Instance.Value;
LoadedApps = true;
AppsReady?.Invoke(this, null);
}).Start();

View File

@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Page
x:Class="DeveloperCommandPalette.MarkdownPage"
x:Class="WindowsCommandPalette.Views.MarkdownPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:DeveloperCommandPalette"
xmlns:devpal="using:DeveloperCommandPalette"
xmlns:local="using:WindowsCommandPalette.Views"
xmlns:mtu="using:Microsoft.Terminal.UI"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -17,7 +18,7 @@
<local:StringNotEmptyToVisibilityConverter x:Key="StringNotEmptyToVisibilityConverter" />
<!--Template for actions in the mode actions dropdown button -->
<DataTemplate x:Key="ContextMenuViewModelTemplate" x:DataType="local:ContextItemViewModel">
<DataTemplate x:Key="ContextMenuViewModelTemplate" x:DataType="devpal:ContextItemViewModel">
<ListViewItem KeyDown="ActionListViewItem_KeyDown" Tapped="ActionListViewItem_Tapped">
<Grid>
<Grid.ColumnDefinitions>

View File

@@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.
using System.ComponentModel;
using DeveloperCommandPalette;
using Microsoft.UI.Input;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
@@ -11,7 +12,7 @@ using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Navigation;
using Microsoft.Windows.CommandPalette.Extensions;
namespace DeveloperCommandPalette;
namespace WindowsCommandPalette.Views;
public sealed class MarkdownPageViewModel : PageViewModel
{