|
@@ -14,6 +14,26 @@
|
|
|
<UserControl.Resources>
|
|
|
<Style TargetType="TextBox">
|
|
|
<Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
|
|
|
+ <Setter Property="Template">
|
|
|
+ <Setter.Value>
|
|
|
+ <ControlTemplate TargetType="TextBox">
|
|
|
+ <Border
|
|
|
+ x:Name="border"
|
|
|
+ Background="White"
|
|
|
+ BorderBrush="#019b9b"
|
|
|
+ BorderThickness="1"
|
|
|
+ CornerRadius="5">
|
|
|
+ <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
|
|
+ </Border>
|
|
|
+
|
|
|
+ <ControlTemplate.Triggers>
|
|
|
+ <Trigger Property="Validation.HasError" Value="True">
|
|
|
+ <Setter TargetName="border" Property="BorderBrush" Value="Red" />
|
|
|
+ </Trigger>
|
|
|
+ </ControlTemplate.Triggers>
|
|
|
+ </ControlTemplate>
|
|
|
+ </Setter.Value>
|
|
|
+ </Setter>
|
|
|
</Style>
|
|
|
<Style TargetType="PasswordBox">
|
|
|
<Setter Property="Validation.ErrorTemplate" Value="{StaticResource ValidationErrorTemplate}" />
|
|
@@ -21,12 +41,19 @@
|
|
|
<Setter.Value>
|
|
|
<ControlTemplate TargetType="PasswordBox">
|
|
|
<Border
|
|
|
+ x:Name="border"
|
|
|
Background="White"
|
|
|
BorderBrush="#019b9b"
|
|
|
BorderThickness="1"
|
|
|
CornerRadius="5">
|
|
|
<ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
|
|
</Border>
|
|
|
+
|
|
|
+ <ControlTemplate.Triggers>
|
|
|
+ <Trigger Property="Validation.HasError" Value="True">
|
|
|
+ <Setter TargetName="border" Property="BorderBrush" Value="Red" />
|
|
|
+ </Trigger>
|
|
|
+ </ControlTemplate.Triggers>
|
|
|
</ControlTemplate>
|
|
|
</Setter.Value>
|
|
|
</Setter>
|
|
@@ -113,9 +140,10 @@
|
|
|
Padding="5,0,0,0"
|
|
|
BorderBrush="#019b9b"
|
|
|
ItemsSource="{Binding UnitTypes}"
|
|
|
- SelectedValue="{Binding SelectedUnitType}"
|
|
|
+ SelectedValue="{Binding SelectedUnitType, UpdateSourceTrigger=PropertyChanged, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"
|
|
|
SelectedValuePath="Key"
|
|
|
- Style="{StaticResource WpfComboBoxStyle}">
|
|
|
+ Style="{StaticResource WpfComboBoxStyle}"
|
|
|
+ Validation.ErrorTemplate="{StaticResource ValidationErrorTemplate}">
|
|
|
<ComboBox.ItemTemplate>
|
|
|
<DataTemplate DataType="{x:Type sys:KeyValuePair`2}">
|
|
|
<Label
|
|
@@ -144,7 +172,8 @@
|
|
|
DisplayMemberPath="Name"
|
|
|
ItemsSource="{Binding Units}"
|
|
|
SelectedItem="{Binding SelectedUnit}"
|
|
|
- Style="{StaticResource WpfComboBoxStyle}" />
|
|
|
+ Style="{StaticResource WpfComboBoxStyle}"
|
|
|
+ Validation.ErrorTemplate="{StaticResource ValidationErrorTemplate}" />
|
|
|
|
|
|
<Label
|
|
|
Grid.Row="4"
|
|
@@ -163,7 +192,8 @@
|
|
|
DisplayMemberPath="Name"
|
|
|
ItemsSource="{Binding CompanyList}"
|
|
|
SelectedItem="{Binding SelectedCompany}"
|
|
|
- Style="{StaticResource WpfComboBoxStyle}" />
|
|
|
+ Style="{StaticResource WpfComboBoxStyle}"
|
|
|
+ Validation.ErrorTemplate="{StaticResource ValidationErrorTemplate}" />
|
|
|
|
|
|
<Label
|
|
|
Grid.Row="6"
|