Click here to Skip to main content
15,884,099 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.1K   522   17  
Validation of input made as easy as possible for Windows.Forms, WPF, console-applications or any other purposes
<Window x:Class="WpfValidatorTutorial.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="WpfValidatorTutroial" SizeToContent="WidthAndHeight" ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen">
  <Grid Margin="3">
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    <Button Name="_btnShowSimpleDialog"
            Grid.Row="0"
            Content="Show _Simple Dialog"
            MinWidth="240"
            Margin="3" 
            Click="_btnShowSimpleDialog_Click" />
    <Button Name="_btnShowComplexDialog"
            Grid.Row="1"
            Content="Show _Complex Dialog"
            MinWidth="240"
            Margin="3" 
            Click="_btnShowComplexDialog_Click" />
    <Button Name="_btnShowSimpleMvvmDialog"
            Grid.Row="2"
            Content="Show _Simple MVVM Dialog"
            MinWidth="240"
            Margin="3" 
            Click="_btnShowSimpleMvvmDialog_Click" />
    <Button Name="_btnShowComplexMvvmDialog"
            Grid.Row="3"
            Content="Show _Complex MVVM Dialog"
            MinWidth="240"
            Margin="3" 
            Click="_btnShowComplexMvvmDialog_Click" />
  </Grid>
</Window>

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