Skip to content

Upgrade System.Windows projects to .NET 10 - #12923

Open
gewarren wants to merge 3 commits into
dotnet:mainfrom
gewarren:upgrade-system-windows
Open

Upgrade System.Windows projects to .NET 10#12923
gewarren wants to merge 3 commits into
dotnet:mainfrom
gewarren:upgrade-system-windows

Conversation

@gewarren

Copy link
Copy Markdown
Collaborator

Contributes to #12713.

Copilot AI review requested due to automatic review settings July 31, 2026 21:17
@gewarren
gewarren requested a review from a team as a code owner July 31, 2026 21:17

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 modernizes a large set of System.Windows* snippet projects by moving them from legacy .NET Framework-style project files to SDK-style projects targeting .NET 10, aligning with issue #12713 (“Modernize all C# code snippets”).

Changes:

  • Upgrades snippet projects from .NET Framework 4.8 to net10.0-windows.
  • Converts legacy MSBuild project files to SDK-style (Microsoft.NET.Sdk) and uses UseWPF / UseWindowsForms as appropriate.
  • Simplifies project items by removing explicit framework assembly references and legacy imports.

Reviewed changes

Copilot reviewed 158 out of 158 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
snippets/csharp/System.Windows/Window/RestoreBounds/WindowRestoreBoundsSnippets.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/VerticalAlignment/Overview/MPA_Layout_VerticallAlignment.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/Vector/Overview/MilVectorSample.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/Vector/.ctor/VectorExamples_snip.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/UIElement/RenderTransformOrigin/project.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/UIElement/RenderSize/AdornersMiscCode.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/UIElement/OpacityMask/OpacityMasking_markup.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/UIElement/OnRender/Light_Custom_Panel_csharp.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/UIElement/IsMouseOver/listviewcheckbox.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/UIElement/IsMouseCaptured/MouseSnippetSample.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/UIElement/IsFocused/PopupPropertiesSample.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/UIElement/IsEnabled/RoutedEventAddRemoveHandler.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/UIElement/InputBindings/CommandingOverviewSnippets.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/UIElement/Focusable/richtextbox_noscrollviewer.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/UIElement/Focus/CursorToEnd.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/UIElement/Clip/ClipPathExample.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/UIElement/AllowDrop/dropopentextfile.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/TextWrapping/Overview/textboxbase_samp.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/TextMarkerStyle/Overview/textmarkerstylesnippets.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/TextDecorations/Overview/Performance.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/TextDecoration/.ctor/TextDecorationSnippets.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/Style/Setters/ListBoxItemStyle.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/Size/Overview/PlotPanel_csharp.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/Setter/Property/StyleOvw1.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/RoutedPropertyChangedEventHandlerT/Overview/autogrid.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/RoutedEventArgs/.ctor/SDKSampleLibrary.csproj Migrate WPF library snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/ResourceDictionary/MergedDictionaries/resourcemerge.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/Point/Overview/PointExamples_snip.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/LocalizabilityAttribute/Category/AttributesSnippets.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/LengthConverter/Overview/Canvas_Positioning_Properties.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/HierarchicalDataTemplate/Overview/hierarchicaldatatemplate.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/Freezable/CreateInstanceCore/freezablesample_csharp.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FrameworkPropertyMetadata/.ctor/PropertyMetadataAPIs.csproj Migrate WPF library snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FrameworkElement/ToolTip/StatusBar.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FrameworkElement/Style/FEResource.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FrameworkElement/Parent/GeometryDesigner.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FrameworkElement/Name/animateheight_csharp.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FrameworkElement/MoveFocus/FocusSample.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FrameworkElement/LayoutTransform/LayoutTransformCsharp.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FrameworkElement/IsLoaded/GroupBoxExample.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FrameworkElement/GetVisualChild/ResizingAdorner.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FrameworkElement/DefaultStyleKey/CustomControlLibrary.csproj Migrate WPF library snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FrameworkElement/DataContext/MasterDetail.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FrameworkElement/ActualWidth/Width_MinWidth_MaxWidth_CSharp.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FrameworkElement/ActualHeight/Height_MinHeight_MaxHeight_CSharp.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FrameworkContentElement/ToolTip/TableSnippets2.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FrameworkContentElement/Parent/TextPointer_Snippets.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FrameworkContentElement/ForceCursor/forcecursor.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FrameworkContentElement/ContextMenuClosing/cursors.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FontCapitals/Overview/OpenTypeFontSnippets.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/FlowDirection/Overview/BlockSnippets.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/ExceptionRoutedEventArgs/ErrorException/MediaElementExample.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/EventTrigger/Overview/StyleEventTriggerAnimation.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/EventManager/RegisterClassHandler/SDKSampleLibrary.csproj Migrate WPF library snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/DependencyObjectType/FromSystemType/PropertiesOvwSupport.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/DependencyObject/Overview/WPFAquariumObjects.csproj Migrate WPF library snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/DependencyObject/InvalidateProperty/SDKSampleLibrary.csproj Migrate WPF library snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/DependencyObject/CoerceValue/SDKSampleLibrary.csproj Migrate WPF library snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/DependencyObject/ClearValue/DPClearValue.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/DataTemplate/Overview/DataTemplatingSample.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/CornerRadius/Overview/ThicknessSamp.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/ContentElement/AllowDrop/ContentElementsSmorgasbord.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/ContentElement/AddHandler/EventOvwSupport.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/Condition/Overview/ControlTemplateExamples.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/Condition/Binding/DataTrigger.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/ComponentResourceKey/.ctor/CorePseudocode.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/CoerceValueCallback/Overview/DPCustom.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/Clipboard/Overview/DragDropMiscCode.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows/BaselineAlignment/Overview/flowmiscsnippets_snip.csproj Migrate WPF snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Threading/DispatcherObject/CheckAccess/DispatcherObjectAccessSample.csproj Migrate WPF threading snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Threading/Dispatcher/Overview/ThreadingPrimeNumberSample.csproj Migrate WPF threading snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Threading/Dispatcher/CheckAccess/DispatcherAccessSample.csproj Migrate WPF threading snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Threading/Dispatcher/BeginInvoke/ThreadingWeatherForecastSample.csproj Migrate WPF threading snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Shapes/Shape/Fill/BrushesMiscSnippets.csproj Migrate WPF shapes snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Shapes/Ellipse/Overview/ShapesProcedural.csproj Migrate WPF shapes snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Media/ColorContext/Overview/BitmapImageProps.csproj Migrate WPF media snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Media.Imaging/WmpBitmapDecoder/.ctor/WDPEncoderDecoder.csproj Migrate WPF imaging snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Media.Imaging/TiffBitmapDecoder/.ctor/TiffEncoderDecoder.csproj Migrate WPF imaging snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Media.Imaging/PngBitmapDecoder/.ctor/PngEncoderDecoder.csproj Migrate WPF imaging snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Media.Imaging/JpegBitmapDecoder/.ctor/JpegEncoderDecoder.csproj Migrate WPF imaging snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Media.Imaging/GifBitmapDecoder/.ctor/GifEncoderDecoder.csproj Migrate WPF imaging snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Media.Imaging/CachedBitmap/Overview/CachedBitmapExample.csproj Migrate WPF imaging snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Media.Imaging/BmpBitmapDecoder/.ctor/BitmapEncoderDecoder.csproj Migrate WPF imaging snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Media.Imaging/BitmapDecoder/CreateInPlaceBitmapMetadataWriter/BitmapMetadata.csproj Migrate WPF imaging snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Media.Imaging/BitmapCodecInfo/Overview/BitmapFrame.csproj Migrate WPF imaging snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Media.Animation/Animatable/BeginAnimation/animateproperty_csharp.csproj Migrate WPF animation snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Markup.Localizer/BamlLocalizableResource/Overview/GrabBaml.csproj Migrate WPF markup/localizer snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Ink/Stroke/GetClipResult/HitTestSample_CS.csproj Migrate WPF ink snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Automation/Automation/AddStructureChangedEventHandler/FocusTracker.csproj Migrate UIAutomation snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Automation.Provider/IInvokeProvider/Invoke/UIAProvider.csproj Migrate UIAutomation provider (WinForms/WPF) snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Automation.Provider/IGridItemProvider/Column/PatternProviders.csproj Migrate UIAutomation provider (WinForms/WPF) snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Forms/SplitContainer/TabStop/splitcontainer.csproj Migrate WinForms snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Data/BindingExpression/Overview/CodeOnlyBinding.csproj Migrate WPF data binding snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Controls/WrapPanel/Overview/WrapPanel_Code_csharp.csproj Migrate WPF controls snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Controls/ScrollBarVisibility/Overview/ScrollViewer_wcp.csproj Migrate WPF controls snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Controls/Panel/SetZIndex/CanvasZ-Order.csproj Migrate WPF controls snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Controls/MediaElement/Stretch/ViewboxCode.csproj Migrate WPF controls snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Controls/Image/Source/StackPanel_Ovw_Sample4.csproj Migrate WPF controls snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Controls/Grid/Overview/Grid_Code_csharp.csproj Migrate WPF controls snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Controls/DockPanel/Dock/DockPanel_Ovw_Sample.csproj Migrate WPF controls snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Controls/Canvas/Overview/Canvas_Ovw_Sample.csproj Migrate WPF controls snippet project to SDK-style and target net10.0-windows.
snippets/csharp/System.Windows.Controls/Border/Overview/Margin_Padding_Alignment_Sample.csproj Migrate WPF controls snippet project to SDK-style and target net10.0-windows.
Suppressed comments (2)

snippets/csharp/System.Windows/RoutedPropertyChangedEventHandlerT/Overview/autogrid.csproj:22

  • There are duplicate MSBuild:Compile metadata entries on this Page item. The second entry is redundant.
    snippets/csharp/System.Windows/LengthConverter/Overview/Canvas_Positioning_Properties.csproj:22
  • There are duplicate MSBuild:Compile metadata entries on this Page item. The second entry is redundant.

gewarren added 2 commits July 31, 2026 16:01
Removed duplicate Generator entries for ApplicationDefinition and Page.
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.

2 participants