114 lines
8.1 KiB
XML
114 lines
8.1 KiB
XML
<Window x:Class="Hermes.CitoyenWindow"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:local="clr-namespace:Hermes"
|
|
mc:Ignorable="d"
|
|
Title="Informations" Height="400" Width="750"
|
|
ResizeMode="NoResize"
|
|
xmlns:Validation="clr-namespace:Hermes.Validation"
|
|
xmlns:Converter="clr-namespace:Hermes.Converter"
|
|
WindowStartupLocation="CenterOwner">
|
|
|
|
<Window.Resources>
|
|
<Converter:NegateBoolean x:Key="NegateBoolean"/>
|
|
</Window.Resources>
|
|
|
|
<Grid Background="WhiteSmoke">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="320"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<WrapPanel Grid.Row="0">
|
|
<StackPanel Margin="10,10,0,0">
|
|
<Label>Civilité :</Label>
|
|
<ComboBox Name="civiliteComboBox" SelectedItem="{Binding Civilite}" Height="23" Width="150"/>
|
|
<Label>Nom :</Label>
|
|
<TextBox Name="nomTextBox" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}" Validation.Error="ValidationError" Binding.TargetUpdated="BindingTargetUpdated" Binding.SourceUpdated="BindingSourceUpdated" HorizontalAlignment="Left" VerticalContentAlignment="Center" Height="23" Width="150">
|
|
<TextBox.Text>
|
|
<Binding Path="Nom" NotifyOnSourceUpdated="True" NotifyOnTargetUpdated="true" NotifyOnValidationError="true">
|
|
<Binding.ValidationRules>
|
|
<Validation:MandatoryString/>
|
|
</Binding.ValidationRules>
|
|
</Binding>
|
|
</TextBox.Text>
|
|
</TextBox>
|
|
<Label>Nom de naissance :</Label>
|
|
<TextBox Name="nomNaissanceTextBox" Text="{Binding Path=NomNaissance}" HorizontalAlignment="Left" VerticalContentAlignment="Center" Height="23" Width="150"/>
|
|
<Label>Prénom :</Label>
|
|
<TextBox Name="prenomTextBox" Text="{Binding Path=Prenom}" HorizontalAlignment="Left" VerticalContentAlignment="Center" Height="23" Width="150"/>
|
|
<Label>Age :</Label>
|
|
<TextBox Name="ageTextBox" ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}" Validation.Error="ValidationError" Binding.TargetUpdated="BindingTargetUpdated" Binding.SourceUpdated="BindingSourceUpdated" HorizontalAlignment="Left" VerticalContentAlignment="Center" Height="23" Width="30">
|
|
<TextBox.Text>
|
|
<Binding Path="Age" NotifyOnSourceUpdated="True" NotifyOnTargetUpdated="true" NotifyOnValidationError="true">
|
|
<Binding.ValidationRules>
|
|
<Validation:Age/>
|
|
</Binding.ValidationRules>
|
|
</Binding>
|
|
</TextBox.Text>
|
|
</TextBox>
|
|
<Label>Profession :</Label>
|
|
<TextBox Name="professionTextBox" Text="{Binding Path=Profession}" HorizontalAlignment="Left" VerticalContentAlignment="Center" Height="23" Width="150"/>
|
|
</StackPanel>
|
|
<StackPanel>
|
|
<GroupBox Header="Résidence" Margin="10,10,0,0" VerticalAlignment="Top">
|
|
<StackPanel>
|
|
<RadioButton Name="principaleResCheckBox" IsChecked="{Binding Path=TypeResidence, Converter={StaticResource NegateBoolean}}" Margin="5,5,5,0">Principale</RadioButton>
|
|
<RadioButton Name="secondResCheckBox" IsChecked="{Binding Path=TypeResidence}" Margin="5,5,5,5">Secondaire</RadioButton>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
<GroupBox Header="Adresse Locale" Margin="10,10,0,0" VerticalAlignment="Top">
|
|
<StackPanel>
|
|
<Label>Numéro et rue :</Label>
|
|
<TextBox Name="adresseTextBox" Text="{Binding Path=Adresse}" HorizontalAlignment="Left" VerticalContentAlignment="Center" Height="23" Width="150"/>
|
|
<Label>Bâtiment :</Label>
|
|
<TextBox Name="adresseBatimentTextBox" Text="{Binding Path=AdresseBatiment}" HorizontalAlignment="Left" VerticalContentAlignment="Center" Height="23" Width="150"/>
|
|
<Label>Numéro d'appartement:</Label>
|
|
<TextBox Name="adresseNumeroBatimentTextBox" Text="{Binding Path=AdresseNumeroBatiment}" HorizontalAlignment="Left" VerticalContentAlignment="Center" Height="23" Width="150"/>
|
|
<Label>Quartier :</Label>
|
|
<TextBox Name="quartierTextBox" Text="{Binding Path=Quartier}" HorizontalAlignment="Left" VerticalContentAlignment="Center" Height="23" Width="150"/>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
</StackPanel>
|
|
<StackPanel>
|
|
<GroupBox IsEnabled="{Binding IsChecked, ElementName=secondResCheckBox}" x:Name="mainAddrGroupBox" Header="Adresse" Margin="10,10,0,0" VerticalAlignment="Top" >
|
|
<GroupBox.Style>
|
|
<Style>
|
|
<Style.Triggers>
|
|
<Trigger Property="Control.IsEnabled" Value="False">
|
|
<Setter Property="Control.Foreground" Value ="#FF6D6D6D" />
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</GroupBox.Style>
|
|
<StackPanel>
|
|
<Label IsEnabled="{Binding IsEnabled, ElementName=mainAddrGroupBox}">Numéro et rue :</Label>
|
|
<TextBox Name="adresseExtTextBox" Text="{Binding Path=AdresseExt}" IsEnabled="{Binding IsEnabled, ElementName=mainAddrGroupBox}" HorizontalAlignment="Left" VerticalContentAlignment="Center" Height="23" Width="150"/>
|
|
<Label IsEnabled="{Binding IsEnabled, ElementName=mainAddrGroupBox}">Code postal :</Label>
|
|
<TextBox Name="adresseExtCPTextBox" Text="{Binding Path=AdresseExtCP}" IsEnabled="{Binding IsEnabled, ElementName=mainAddrGroupBox}" HorizontalAlignment="Left" VerticalContentAlignment="Center" Height="23" Width="60"/>
|
|
<Label IsEnabled="{Binding IsEnabled, ElementName=mainAddrGroupBox}">Ville :</Label>
|
|
<TextBox Name="adresseExtVilleTextBox" Text="{Binding Path=AdresseExtVille}" IsEnabled="{Binding IsEnabled, ElementName=mainAddrGroupBox}" HorizontalAlignment="Left" VerticalContentAlignment="Center" Height="23" Width="150"/>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
</StackPanel>
|
|
<StackPanel>
|
|
<GroupBox Header="Contact" Margin="10,10,0,0" VerticalAlignment="Top">
|
|
<StackPanel>
|
|
<Label>E-Mail :</Label>
|
|
<TextBox Name="mailTextBox" Text="{Binding Path=Mail}" HorizontalAlignment="Left" VerticalContentAlignment="Center" Height="23" Width="200"/>
|
|
<Label>Téléphone :</Label>
|
|
<TextBox Name="telTextBox" Text="{Binding Path=Tel}" HorizontalAlignment="Left" VerticalContentAlignment="Center" Height="23" Width="150"/>
|
|
<Label>Mobile :</Label>
|
|
<TextBox Name="telPortTextBox" Text="{Binding Path=TelPort}" HorizontalAlignment="Left" VerticalContentAlignment="Center" Height="23" Width="150"/>
|
|
</StackPanel>
|
|
</GroupBox>
|
|
</StackPanel>
|
|
</WrapPanel>
|
|
<WrapPanel Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0">
|
|
<Button Height="25" Margin="0,0,10,0" Width="100" Click="Save_Click" IsDefault="True">Enregister</Button>
|
|
<Button Height="25" Width="100" Click="Cancel_Click">Annuler</Button>
|
|
</WrapPanel>
|
|
</Grid>
|
|
</Window>
|