Click here to Skip to main content
15,896,606 members
Articles / Desktop Programming / WPF

Validation in Windows Presentation Foundation

Rate me:
Please Sign up or sign in to vote.
4.87/5 (134 votes)
19 Aug 200612 min read 883K   18.7K   263  
In this article, I'll walk you through using the built-in Validation classes that exist in Windows Presentation Foundation. I'll then discuss an alternative approach to validation that might suit a richer domain layer, by creating a custom WPF ErrorProvider.

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PaulStovell.Samples.WpfValidation", "PaulStovell.Samples.WpfValidation\PaulStovell.Samples.WpfValidation.csproj", "{AEA92453-58A6-4631-999D-83E25C6C9410}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{AEA92453-58A6-4631-999D-83E25C6C9410}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{AEA92453-58A6-4631-999D-83E25C6C9410}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{AEA92453-58A6-4631-999D-83E25C6C9410}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{AEA92453-58A6-4631-999D-83E25C6C9410}.Release|Any CPU.Build.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Octopus Deploy
Australia Australia
My name is Paul Stovell. I live in Brisbane and develop an automated release management product, Octopus Deploy. Prior to working on Octopus I worked for an investment bank in London, and for Readify. I also work on a few open source projects. I am a Microsoft MVP for Client Application Development.

Comments and Discussions