Refresh PhotoEditor C# sample to modern Windows App SDK conventions#654
Open
niels9001 wants to merge 2 commits into
Open
Refresh PhotoEditor C# sample to modern Windows App SDK conventions#654niels9001 wants to merge 2 commits into
niels9001 wants to merge 2 commits into
Conversation
…nventions Rebuilds the C# PhotoEditor sample on a fresh `dotnet new winui` project and ports the XAML/C# forward, removing Project Reunion-era compatibility cruft. - Modern window chrome: Mica backdrop + `TitleBar` with app icon and `ExtendsContentIntoTitleBar`, replacing the old custom title bar plumbing. - Modern lifecycle: `App.MainWindow` / `DispatcherQueue` instead of the static `App.Window` / `CoreWindow`-bound patterns; pickers initialized via the window handle. - Removed runtime API detection: dropped all `ApiInformation.IsApiContractPresent` checks and the `contract6/7` conditional XAML namespaces from the FancySlider template. - Nullable reference types enabled and annotated across the sample. - Robust thumbnail loading: fall back to decoding the image file directly when the packaged install location has no shell-generated thumbnail. - csproj modernized to Central Package Management (no inline versions), net8 TFM, and the repo-standard package set. Builds clean (0 warnings / 0 errors) and smoke-tested: the collection grid loads the 20 bundled sample photos and the Win2D editor runs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
OS compatibility for this packaged sample is already declared via TargetDeviceFamily in Package.appxmanifest, so the Win32-style <compatibility>/<supportedOS> block is unneeded boilerplate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refreshing the PhotoEditor C# sample
The C# (
cs-winui) PhotoEditor sample was heavily outdated and carried a lot of Project Reunion-era workarounds. This PR refreshes it to current Windows App SDK conventions by scaffolding a freshdotnet new winuiproject and porting the XAML/C# forward.What changed
Modern window chrome
TitleBarwith the app icon andExtendsContentIntoTitleBar, replacing the old hand-rolled title bar.Modern app lifecycle
App.MainWindow/DispatcherQueueinstead of the staticApp.WindowandCoreWindow-bound patterns.WindowNative.GetWindowHandle).Removed Project Reunion-era cruft
ApiInformation.IsApiContractPresentruntime API-detection check.contract6/contract7conditional XAML namespaces and their conditional attributes from the FancySlider control template.app.manifest(this sample is packaged).Correctness & polish
NullReferenceExceptionon launch).csprojmodernized to the repo's Central Package Management (no inline package versions), the net8 TFM, and the standard package set.Validation