Skip to content

Migrate remaining WPF legacy snippets#2265

Merged
adegeo merged 5 commits into
mainfrom
wpf/2264/migratecode
Jul 20, 2026
Merged

Migrate remaining WPF legacy snippets#2265
adegeo merged 5 commits into
mainfrom
wpf/2264/migratecode

Conversation

@adegeo

@adegeo adegeo commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Copilot AI review requested due to automatic review settings July 20, 2026 17:02
@adegeo adegeo changed the title Migrate code Migrate remaining WPF legacy snippets Jul 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates remaining legacy WPF snippet references (from ~/samples/snippets/...) into per-article ./snippets/... folders, aligning snippet usage with the repo’s current :::code pattern and unblocking follow-up deletion of the old snippets folder (Fixes #2264).

Changes:

  • Updated three WPF security articles to reference local snippet files via :::code ... source=... id=....
  • Added new per-article snippet projects and source files for WPF platform security and partial-trust security examples (C# and VB).
  • Added a new WPF security-wpf snippet set demonstrating SandboxExternalContent usage in Frame and NavigationWindow.

Reviewed changes

Copilot reviewed 31 out of 33 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
dotnet-desktop-guide/wpf/wpf-security-strategy-platform-security.md Switches legacy snippet includes to local :::code references.
dotnet-desktop-guide/wpf/wpf-partial-trust-security.md Switches legacy snippet includes to local :::code references.
dotnet-desktop-guide/wpf/security-wpf.md Replaces legacy XAML snippet includes with local :::code references and adjusts surrounding text.
dotnet-desktop-guide/wpf/snippets/wpf-security-strategy-platform-security/vb/WPFPlatformSecuritySnippet.vbproj Adds VB project to build the platform-security snippet set.
dotnet-desktop-guide/wpf/snippets/wpf-security-strategy-platform-security/vb/Page1.xaml.vb Adds VB code-behind snippet for permission assert example.
dotnet-desktop-guide/wpf/snippets/wpf-security-strategy-platform-security/vb/Page1.xaml Adds VB Page XAML used by the snippet project.
dotnet-desktop-guide/wpf/snippets/wpf-security-strategy-platform-security/vb/Application.xaml Adds VB application definition for the snippet project.
dotnet-desktop-guide/wpf/snippets/wpf-security-strategy-platform-security/csharp/WPFPlatformSecuritySnippet.csproj Adds C# project to build the platform-security snippet set.
dotnet-desktop-guide/wpf/snippets/wpf-security-strategy-platform-security/csharp/Page1.xaml.cs Adds C# code-behind snippet for permission assert example.
dotnet-desktop-guide/wpf/snippets/wpf-security-strategy-platform-security/csharp/Page1.xaml Adds C# Page XAML used by the snippet project.
dotnet-desktop-guide/wpf/snippets/wpf-security-strategy-platform-security/csharp/App.xaml Adds C# application definition for the snippet project.
dotnet-desktop-guide/wpf/snippets/wpf-partial-trust-security/vb/WpfPartialTrustSecurity.vbproj Adds VB project to build the partial-trust snippet set.
dotnet-desktop-guide/wpf/snippets/wpf-partial-trust-security/vb/Page1.xaml.vb Adds VB page code-behind for the snippet project.
dotnet-desktop-guide/wpf/snippets/wpf-partial-trust-security/vb/Page1.xaml Adds VB Page XAML used by the snippet project.
dotnet-desktop-guide/wpf/snippets/wpf-partial-trust-security/vb/FileHandlingGraceful.vb Adds VB “graceful degradation” snippet implementation.
dotnet-desktop-guide/wpf/snippets/wpf-partial-trust-security/vb/FileHandling.vb Adds VB permission-detection snippet implementation.
dotnet-desktop-guide/wpf/snippets/wpf-partial-trust-security/vb/Application.xaml Adds VB application definition for the snippet project.
dotnet-desktop-guide/wpf/snippets/wpf-partial-trust-security/csharp/WpfPartialTrustSecurity.csproj Adds C# project to build the partial-trust snippet set.
dotnet-desktop-guide/wpf/snippets/wpf-partial-trust-security/csharp/Page1.xaml.cs Adds C# page code-behind for the snippet project.
dotnet-desktop-guide/wpf/snippets/wpf-partial-trust-security/csharp/Page1.xaml Adds C# Page XAML used by the snippet project.
dotnet-desktop-guide/wpf/snippets/wpf-partial-trust-security/csharp/FileHandlingGraceful.cs Adds C# “graceful degradation” snippet implementation.
dotnet-desktop-guide/wpf/snippets/wpf-partial-trust-security/csharp/FileHandling.cs Adds C# permission-detection snippet implementation.
dotnet-desktop-guide/wpf/snippets/wpf-partial-trust-security/csharp/App.xaml Adds C# application definition for the snippet project.
dotnet-desktop-guide/wpf/snippets/security-wpf/csharp/SecurityWpf.csproj Adds C# WPF snippet project for security-wpf.md examples.
dotnet-desktop-guide/wpf/snippets/security-wpf/csharp/NavigationWindowExample.xaml Adds XAML snippet for sandboxed NavigationWindow external content.
dotnet-desktop-guide/wpf/snippets/security-wpf/csharp/MainWindow.xaml.cs Adds code-behind for the WPF snippet project main window.
dotnet-desktop-guide/wpf/snippets/security-wpf/csharp/MainWindow.xaml Adds XAML snippet for sandboxed Frame external content.
dotnet-desktop-guide/wpf/snippets/security-wpf/csharp/ExternalContentPage.xaml Adds external content page referenced by the sandboxing examples.
dotnet-desktop-guide/wpf/snippets/security-wpf/csharp/AssemblyInfo.cs Adds WPF theme info assembly attribute.
dotnet-desktop-guide/wpf/snippets/security-wpf/csharp/App.xaml.cs Adds WPF application class for the snippet project.
dotnet-desktop-guide/wpf/snippets/security-wpf/csharp/App.xaml Adds WPF application definition for the snippet project.

Comment thread dotnet-desktop-guide/wpf/wpf-security-strategy-platform-security.md Outdated
Comment thread dotnet-desktop-guide/wpf/wpf-partial-trust-security.md Outdated
Comment thread dotnet-desktop-guide/wpf/security-wpf.md
@adegeo
adegeo enabled auto-merge (squash) July 20, 2026 19:09

@BillWagner BillWagner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. Let's :shipit:

@adegeo
adegeo merged commit 5b136d7 into main Jul 20, 2026
8 checks passed
@adegeo
adegeo deleted the wpf/2264/migratecode branch July 20, 2026 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delete old WPF snippets for root articles

3 participants