Skip to content
Repository for WPF related samples
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Accessibility Remove multitargeting of netcore projects (#66) Dec 4, 2018
Animation Remove multitargeting of netcore projects (#66) Dec 4, 2018
Application Management Remove multitargeting of netcore projects (#66) Dec 4, 2018
Clipboard Remove multitargeting of netcore projects (#66) Dec 4, 2018
Data Binding Fix binding error in Division label #48 (#56) Apr 30, 2019
Documents Remove multitargeting of netcore projects (#66) Dec 4, 2018
Drag and Drop Use safe data formats casting (#81) Apr 30, 2019
Element Tree Remove multitargeting of netcore projects (#66) Dec 4, 2018
Elements Remove multitargeting of netcore projects (#66) Dec 4, 2018
Events Remove multitargeting of netcore projects (#66) Dec 4, 2018
Getting Started @WilliamAntonRohm's WPF Desktop Application Walkthough updates (#79) Apr 23, 2019
Globalization and Localization Remove multitargeting of netcore projects (#66) Dec 4, 2018
Graphics Fix location of MyData directory (#80) Mar 22, 2019
Input and Commands Fix typo (#76) Feb 21, 2019
Migration and Interoperability Small update to HostingWpfUserControlInWf .NET core project to match … Apr 24, 2019
PerMonitorDPI Convert Word doc to markdown (#70) Feb 21, 2019
Properties Remove multitargeting of netcore projects (#66) Dec 4, 2018
Resources Remove multitargeting of netcore projects (#66) Dec 4, 2018
Sample Applications Fix problem with culture concerning floating values (#57) Apr 30, 2019
Speech and Media Remove multitargeting of netcore projects (#66) Dec 4, 2018
Styles & Templates fixed bad paths in IntroToStylingAndTemplating (#73) Apr 30, 2019
Threading Fix typo (#63) Dec 6, 2018
Tools/LocBaml Open source the WPF Application localization tool (LocBaml) (#84) Apr 24, 2019
Visual Layer Remove multitargeting of netcore projects (#66) Dec 4, 2018
Windows Remove multitargeting of netcore projects (#66) Dec 4, 2018
.gitattributes Initial merge Aug 12, 2015
.gitignore gitignore change again Nov 24, 2015
Directory.Build.props Remove multitargeting of netcore projects (#66) Dec 4, 2018
LICENSE Initial commit Apr 15, 2015
README.md Add needed space within the README document (#39) Apr 24, 2019
WPFSamples.netcore.sln Remove multitargeting of netcore projects (#66) Dec 4, 2018
WPFSamples.sln Adding CustomComboBox project to the Sample Applications (#52) Apr 30, 2019

README.md

WPF-Samples

This repo contains the samples that demonstrate the API usage patterns and popular features for the Windows Presentation Foundation in the .NET Framework for Desktop. These samples were initially hosted on MSDN, and we are gradually moving all the interesting WPF samples over to GitHub. All the samples have been retargeted to .NET 4.7.2 and .NET Core 3.0.

For additional WPF samples, see WPF Samples.

Please note that the documentation on the repo is still being updated, so all links might not point to the right location.

License

Unless otherwise mentioned, the samples are released under the MIT license

Help us improve our samples

Help us improve out samples by sending us a pull-request or opening a GitHub Issue

Questions: mail wpfteam@microsoft.com

WPF development

These samples require Visual Studio 2017 to build, test, and deploy. The .NET Core projects (netcore.csproj) require the .NET Core 3 SDK.

Get a free copy of Visual Studio 2017 Community Edition with support for building WPF apps

.NET Core SDK

WPF on .NET Core 3.0 has been open-sourced, and is now available on Github

Using the samples

To use the samples with Git, clone the WPF-Samples repository with 'git clone https://github.com/microsoft/WPF-Samples'

After cloning the WPF-Samples respository, there will be two solution files in the root directory: WPF-Samples.sln (targeting .NET Framework 4.7.2) and WPF-Samples.netcore.sln (.NET SDK, targeting .NET core 3.0).

  • To build the samples, open one of the solution files in Visual Studio 2017 and build the solution.
  • Alternatively, navigate to the directory of a sample. There will be two project files: sampleName.csproj (.NET 4.7.2) and sampleName.netcore.csproj (.NET Core 3.0). Build with 'dotnet build' or 'msbuild' specifying the target project file.

The easiest way to use these samples without using Git is to download the zip file containing the current version (using the link below or by clicking the "Download ZIP" button on the repo page). You can then unzip the entire archive and use the samples in Visual Studio 2017.

Download the samples ZIP

Notes:

  • Before you unzip the archive, right-click it, select Properties, and then select Unblock.
  • Most samples should work independently
  • By default, all the .NET Framework samples target .NET 4.7.2, you can change this in the Project->Properties page in Visual Studio.
  • The .NET SDK versions of the projects target .NET core 3.0.

For more info about the programming models, platforms, languages, and APIs demonstrated in these samples, please refer to the guidance available in MSDN. These samples are provided as-is in order to indicate or demonstrate the functionality of the programming models and feature APIs for WPF.

You can’t perform that action at this time.