Click here to Skip to main content
15,881,882 members
Articles / Desktop Programming / WPF

Displaying User Friendly Enum Values in WPF

Rate me:
Please Sign up or sign in to vote.
4.94/5 (25 votes)
12 Mar 2014CPOL13 min read 105K   1.7K   68  
Presents a helper class to easily display user-friendly enum value representations including customizable and localizable text, images, and arbitrary XAML content. This class can also be used as a general XAML switch statement for enum and non-enum classes.

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Windows Desktop
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnumTools", "EnumTools\EnumTools.csproj", "{2CCEBD48-4F1E-4910-A671-6087ABCCEE6F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EnumTools.Demo", "EnumTools.Demo\EnumTools.Demo.csproj", "{C872D821-6844-415C-9898-9CB5F88AAB37}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Debug|Mixed Platforms = Debug|Mixed Platforms
		Debug|x86 = Debug|x86
		Release|Any CPU = Release|Any CPU
		Release|Mixed Platforms = Release|Mixed Platforms
		Release|x86 = Release|x86
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{2CCEBD48-4F1E-4910-A671-6087ABCCEE6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{2CCEBD48-4F1E-4910-A671-6087ABCCEE6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{2CCEBD48-4F1E-4910-A671-6087ABCCEE6F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
		{2CCEBD48-4F1E-4910-A671-6087ABCCEE6F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
		{2CCEBD48-4F1E-4910-A671-6087ABCCEE6F}.Debug|x86.ActiveCfg = Debug|Any CPU
		{2CCEBD48-4F1E-4910-A671-6087ABCCEE6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{2CCEBD48-4F1E-4910-A671-6087ABCCEE6F}.Release|Any CPU.Build.0 = Release|Any CPU
		{2CCEBD48-4F1E-4910-A671-6087ABCCEE6F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
		{2CCEBD48-4F1E-4910-A671-6087ABCCEE6F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
		{2CCEBD48-4F1E-4910-A671-6087ABCCEE6F}.Release|x86.ActiveCfg = Release|Any CPU
		{C872D821-6844-415C-9898-9CB5F88AAB37}.Debug|Any CPU.ActiveCfg = Debug|x86
		{C872D821-6844-415C-9898-9CB5F88AAB37}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
		{C872D821-6844-415C-9898-9CB5F88AAB37}.Debug|Mixed Platforms.Build.0 = Debug|x86
		{C872D821-6844-415C-9898-9CB5F88AAB37}.Debug|x86.ActiveCfg = Debug|x86
		{C872D821-6844-415C-9898-9CB5F88AAB37}.Debug|x86.Build.0 = Debug|x86
		{C872D821-6844-415C-9898-9CB5F88AAB37}.Release|Any CPU.ActiveCfg = Release|x86
		{C872D821-6844-415C-9898-9CB5F88AAB37}.Release|Mixed Platforms.ActiveCfg = Release|x86
		{C872D821-6844-415C-9898-9CB5F88AAB37}.Release|Mixed Platforms.Build.0 = Release|x86
		{C872D821-6844-415C-9898-9CB5F88AAB37}.Release|x86.ActiveCfg = Release|x86
		{C872D821-6844-415C-9898-9CB5F88AAB37}.Release|x86.Build.0 = Release|x86
	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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Sweden Sweden
Henrik Jonsson is a Microsoft Professional Certified Windows Developer (MCPD) that currently works as an IT consultant in Västerås, Sweden.

Henrik has worked in several small and large software development projects in various roles such as architect, developer, CM and tester.

He regularly reads The Code Project articles to keep updated about .NET development and get new ideas. He has contributed with articles presenting some useful libraries for Undo/Redo, Dynamic Linq Sorting and a Silverlight 5 MultiBinding solution.

Comments and Discussions