From 73f02090429ff1ffd62d8b5242745448fc8ddeac Mon Sep 17 00:00:00 2001 From: Lex Li Date: Wed, 27 May 2026 02:36:03 -0400 Subject: [PATCH 1/2] Port to Uno Platform via Win2D shim and enable DevFlow --- App.xaml.cs | 10 ++++++++++ Platforms/Desktop/Program.cs | 20 ++++++++++++++++++++ WinIconFinder.csproj | 32 ++++++++++++++++++++++++-------- global.json | 5 +++++ 4 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 Platforms/Desktop/Program.cs create mode 100644 global.json diff --git a/App.xaml.cs b/App.xaml.cs index 9956f6a..b03e783 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -1,5 +1,8 @@ using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; +#if DEBUG +using LeXtudio.DevFlow.Agent.Uno; +#endif // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. @@ -11,6 +14,9 @@ namespace WinIconFinder; /// public partial class App : Application { +#if DEBUG + private UnoAgentService? _devFlowAgent; +#endif /// /// The main application window. Use App.Window from any class that needs /// the window reference (for dialogs, pickers, interop, etc.). @@ -46,6 +52,10 @@ public App() /// Details about the launch request and process. protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) { +#if DEBUG + _devFlowAgent = new UnoAgentService(); + _devFlowAgent.Start(); +#endif Window = new MainWindow(); DispatcherQueue = Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread(); Window.Activate(); diff --git a/Platforms/Desktop/Program.cs b/Platforms/Desktop/Program.cs new file mode 100644 index 0000000..a7bcf48 --- /dev/null +++ b/Platforms/Desktop/Program.cs @@ -0,0 +1,20 @@ +using System.Threading.Tasks; +using Uno.UI.Hosting; + +namespace WinIconFinder; + +internal class Program +{ + [STAThread] + public static async Task Main(string[] args) + { + var host = UnoPlatformHostBuilder.Create() + .App(() => new App()) + .UseWin32() + .UseX11() + .UseMacOS() + .Build(); + + await host.RunAsync(); + } +} diff --git a/WinIconFinder.csproj b/WinIconFinder.csproj index d7ffa6a..23eac03 100644 --- a/WinIconFinder.csproj +++ b/WinIconFinder.csproj @@ -1,19 +1,28 @@ - + WinExe - net10.0-windows10.0.26100.0 + net10.0-desktop;net10.0-windows10.0.19041.0 10.0.17763.0 WinIconFinder app.manifest x86;x64;ARM64 - win-x86;win-x64;win-arm64 - win-$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant()) win-$(Platform).pubxml + true + enable + enable + SkiaRenderer; + + + + + + + true false + true true - enable - enable + $(DefineConstants);WINDOWS_APP_SDK @@ -60,17 +69,24 @@ Set false in a above to opt out. --> - + - runtime; build; native; contentfiles; analyzers; buildtransitive all + + + + + + + +