Click here to Skip to main content
15,886,664 members
Articles / Desktop Programming / WPF

A framework for comprehensive validation of user input

Rate me:
Please Sign up or sign in to vote.
4.70/5 (8 votes)
19 Jun 2012CPOL28 min read 31.2K   523   18  
Validation of input made as easy as possible for Windows.Forms, WPF, console-applications or any other purposes
using System.Windows;

namespace ValidatorTests.ViewModels
{
	//############################################################################
	/// <summary>
	/// IViewModelMessageProvider defines the interface of an object that provides
	/// access to message boxes.
	/// </summary>
	/// 
	public interface IViewModelMessageProvider
	{
		#region methods

		/// <summary>
		/// Displays a modal message box.
		/// </summary>
		/// 
		/// <param name="text">The message text to show.</param>
		/// <param name="caption">The text of the message box' title bar. If this is
		///   <c>null</c> a default title is provided.</param>
		/// <param name="button">The button to show.</param>
		/// <param name="icon">The icon to display.</param>
		/// <param name="defResult">The default result.</param>
		/// <param name="options">The opitons to set.</param>
		/// 
		/// <returns>The result of the message box.</returns>
		/// 
		MessageBoxResult ShowMessageBox(
			string text,
			string caption = null,
			MessageBoxButton button = MessageBoxButton.OK,
			MessageBoxImage icon = MessageBoxImage.None,
			MessageBoxResult defResult = MessageBoxResult.OK,
			MessageBoxOptions options = MessageBoxOptions.None );

		#endregion
	}
}

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
Germany Germany
I am a software developer since many years and have worked on several large projects especially in financial sectors and the logistics industry.

My favorite programming languages are C, C++ und newly C#.

I am the architect and chief developer of Tricentis TDM Studio (former Q-up) - a generator that primarily creates template based synthetic data for software testing.

Comments and Discussions