| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:ZUI="clr-namespace:CustomUI">
- <Color x:Key="Color.Light.Border.Normal">#ABADB3</Color>
- <Color x:Key="Color.Light.Border.MouseOver">#5CADFF</Color>
- <Color x:Key="Color.Disabled.Background">#F3F3F3</Color>
- <Style x:Key="IpBoxStyle" TargetType="TextBox">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="BorderThickness" Value="0" />
- </Style>
-
- <Style TargetType="{x:Type ZUI:IpTextBox}">
- <Setter Property="BorderBrush" Value="#ABADB3" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="UseLayoutRounding" Value="True" />
- <Setter Property="Padding" Value="1" />
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ZUI:IpTextBox}">
- <Border x:Name="Root" BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- Background="{TemplateBinding Background}"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
- UseLayoutRounding="{TemplateBinding UseLayoutRounding}"
- CornerRadius="0">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <TextBox x:Name="PART_BOX1" Style="{StaticResource IpBoxStyle}"
- FontSize="{TemplateBinding FontSize}"
- FontFamily="{TemplateBinding FontFamily}"/>
- <TextBlock Grid.Column="1" Text="." VerticalAlignment="Bottom" Margin="0,0,0,5" />
- <TextBox x:Name="PART_BOX2" Grid.Column="2" Style="{StaticResource IpBoxStyle}"
- FontSize="{TemplateBinding FontSize}"
- FontFamily="{TemplateBinding FontFamily}"/>
- <TextBlock Grid.Column="3" Text="." VerticalAlignment="Bottom" Margin="0,0,0,5" />
- <TextBox x:Name="PART_BOX3" Grid.Column="4" Style="{StaticResource IpBoxStyle}"
- FontSize="{TemplateBinding FontSize}"
- FontFamily="{TemplateBinding FontFamily}"/>
- <TextBlock Grid.Column="5" Text="." VerticalAlignment="Bottom" Margin="0,0,0,5" />
- <TextBox x:Name="PART_BOX4" Grid.Column="6" Style="{StaticResource IpBoxStyle}"
- FontSize="{TemplateBinding FontSize}"
- FontFamily="{TemplateBinding FontFamily}"/>
- <ZUI:Poptip AllowsTransparency="True" StaysOpen="False" Background="Red"
- BorderThickness="0"
- IsOpen="{Binding IsHasError, Mode=OneWay, RelativeSource={RelativeSource AncestorType=ZUI:IpTextBox}}"
- PlacementEx="TopLeft" PlacementTarget="{Binding ElementName=Root}">
- <TextBlock Text="{TemplateBinding ErrorContent}" Margin="3" Foreground="White" />
- </ZUI:Poptip>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsKeyboardFocused" Value="True">
- <Setter Property="BorderBrush" Value="#0000FF" />
- </Trigger>
- <Trigger Property="IsHasError" Value="True">
- <Setter Property="BorderBrush" Value="Red" />
- </Trigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsKeyboardFocused" Value="True" />
- <Condition Property="IsMouseOver" Value="False" />
- </MultiTrigger.Conditions>
- <Setter Property="BorderBrush" Value="#0000FF" />
- </MultiTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|