<Windows:DataWindow x:Class="Catel.Examples.PersonApplication.UI.Windows.PersonWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Windows="clr-namespace:Catel.Windows;assembly=Catel.Windows"
xmlns:ViewModels="clr-namespace:Catel.Examples.PersonApplication.UI.ViewModels"
xmlns:Converters="clr-namespace:Catel.Examples.PersonApplication.UI.Data.Converters"
xmlns:Models="clr-namespace:Catel.Examples.Models;assembly=Catel.Examples.Models"
xmlns:Controls="clr-namespace:Catel.Windows.Controls;assembly=Catel.Windows"
x:TypeArguments="ViewModels:PersonViewModel" MaxWidth="400" MaxHeight="300">
<!-- Resources -->
<Windows:DataWindow.Resources>
<!-- Converters -->
<Converters:GenderToIsSelectedConverter x:Key="GenderToIsSelectedConverter" />
</Windows:DataWindow.Resources>
<!-- Content -->
<Controls:StackGrid>
<!-- Row definitions -->
<Controls:StackGrid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Controls:StackGrid.RowDefinitions>
<!-- Column definitions -->
<Controls:StackGrid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Controls:StackGrid.ColumnDefinitions>
<!-- Gender -->
<Label Content="Gender" />
<StackPanel Orientation="Horizontal" x:Name="genderStackPanel">
<RadioButton Content="Male" IsChecked="{Binding Gender, Converter={StaticResource GenderToIsSelectedConverter}, ConverterParameter={x:Static Models:Gender.Male}, ValidatesOnDataErrors=True, NotifyOnValidationError=True}"
Validation.ValidationAdornerSiteFor="{Binding ElementName=genderStackPanel}" />
<RadioButton Content="Female" IsChecked="{Binding Gender, Converter={StaticResource GenderToIsSelectedConverter}, ConverterParameter={x:Static Models:Gender.Female}, ValidatesOnDataErrors=True, NotifyOnValidationError=True}"
Validation.ValidationAdornerSiteFor="{Binding ElementName=genderStackPanel}" />
</StackPanel>
<!-- First name -->
<Label Content="First name" />
<TextBox Text="{Binding FirstName, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" />
<!-- Middle name -->
<Label Content="Middle name" />
<TextBox Text="{Binding MiddleName, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" />
<!-- Last name -->
<Label Content="Last name" />
<TextBox Text="{Binding LastName, ValidatesOnDataErrors=True, NotifyOnValidationError=True}" />
</Controls:StackGrid>
</Windows:DataWindow>