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