feat: upgrade to .NET 9 and add ShareX settings panel#5
Conversation
Introduce plugin settings UI for ShareX path and auto-close behavior. Main.cs now implements ISettingProvider, loads persisted Settings, exposes CreateSettingPanel, and appends '-silent' with optional '-autoclose' when running commands. SharexCommand.cs is refactored to an immutable record (init-only properties) and CategoryType enum for clearer intent and safer command definitions; command list initialization in Main.cs is updated accordingly.
There was a problem hiding this comment.
Pull request overview
Upgrades the Flow Launcher ShareX plugin to target .NET 9 (with WPF enabled) and adds a configurable settings panel so users can set the ShareX install path and toggle -autoclose behavior.
Changes:
- Upgrade project target framework to
net9.0-windowsand update NuGet lockfile. - Add WPF settings UI (view + view model + settings storage) exposed via
ISettingProvider. - Update command launching to always include
-silentand optionally-autoclose, using the configured ShareX path.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
Flow.Launcher.Plugin.ShareX-Flow-Plugin.csproj |
Targets .NET 9 and enables WPF for the settings UI. |
packages.lock.json |
Updates lockfile target framework section to net9.0-windows7.0. |
Main.cs |
Implements ISettingProvider, loads settings, and applies new launch args/path logic. |
Settings.cs |
Adds persisted settings model (ShareX path + AutoClose). |
SettingsViewModel.cs |
Adds WPF-binding view model for settings. |
SettingsView.xaml |
Adds settings panel layout and bindings. |
SettingsView.xaml.cs |
Adds folder-browse handler using OpenFolderDialog. |
SharexCommand.cs |
Refactors command model to an immutable record and renames category enum. |
README.md |
Documents settings panel and updated command behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| namespace Flow.Launcher.Plugin.ShareX_Flow_Plugin | ||
| { | ||
| public class SettingsViewModel(Settings settings) : BaseModel | ||
| { | ||
| private readonly Settings Settings = settings; |
There was a problem hiding this comment.
It doesn't fail to compile in Visual Studio 2026
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
| xmlns:local="clr-namespace:Flow.Launcher.Plugin.ShareX_Flow_Plugin" | ||
| mc:Ignorable="d" | ||
| d:DataContext="{d:DesignInstance local:SettingsViewModel}" |
…adability Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…nce its constructor is not parameterless
|
I had a quick look without compiling it yet. Why |
|
Do you save the settings somewhere ? |
Because if ShareX wasn't running before running the command, then its window appears and can interfere with what you were aiming to do. E.g. if you want to record the active window, it will pop up and record itself.
That's handled by Flow Launcher itself when using ISettingProvider and context.API.LoadSettingJsonStorage function :) |
|
Hey, I hope It's ok! Don't mean to rush things :) |
Overview
This PR modernizes the ShareX Flow Launcher plugin by upgrading the target framework to .NET 9 and introducing a user-configurable settings panel.
Changes
1. chore: upgrade plugin target to net9 and update lockfile (47a72a2)
TargetFrameworkfromnet5.0-windowstonet9.0-windows<UseWPF>true</UseWPF>for explicit WPF supportpackages.lock.jsonto reflect new framework2. feat: add ShareX settings panel and configurable launch options (02693c3)
ISettingProviderinShareX_Flow_PluginclassCreateSettingPanel()method exposing settings UISettingsclass with configurable properties:SharexPath: Installation path (default:C:\Program Files\ShareX\)AutoClose: Boolean flag for-autoclosebehaviorSettingsViewModelclass for WPF binding and change notificationsSettingsView.xaml/xaml.csfor UI layout and folder browser dialogSharexCommandto an immutablerecordwithinit-only propertiesCatenum toCategoryTypefor clarityRunCommand()now:-silentflag-autoclosebased on settingsSettings.SharexPathinstead of hardcoded path3. docs: refresh README for settings panel and launch args (34422bf)
Testing
-silentand optional-autocloseCommits
.editorconfiguntracked, left for local use)