| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- <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>
- <PathGeometry x:Key="Error" Figures="M512 83.577816c-237.289317 0-429.650196 192.360879-429.650196 429.650196s192.360879 429.650196 429.650196 429.650196S941.650196 750.517329 941.650196 513.228012 749.289317 83.577816 512 83.577816z m34.016332 644.469294H477.984668v-68.031665h68.031664v68.031665z m0-89.476874H477.984668l-17.734173-340.160322h103.50101l-17.735173 340.160322z" />
- <Style TargetType="{x:Type ZUI:NumbericTextBox}">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="#ABADB3" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="HorizontalAlignment" Value="Stretch" />
- <Setter Property="VerticalAlignment" Value="Stretch" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="UseLayoutRounding" Value="True" />
- <Setter Property="Padding" Value="2,0" />
- <Setter Property="Height" Value="25" />
- <Setter Property="ErrorBackground" Value="Red" />
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- <Setter Property="ErrorContentTemplate">
- <Setter.Value>
- <DataTemplate>
- <TextBlock Text="{Binding .}" Foreground="White" Margin="3" />
- </DataTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ZUI:NumbericTextBox}">
- <Border x:Name="Border"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="{TemplateBinding CornerRadius}"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
- UseLayoutRounding="{TemplateBinding UseLayoutRounding}">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="auto" />
- </Grid.ColumnDefinitions>
- <ScrollViewer x:Name="PART_ContentHost"
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- HorizontalScrollBarVisibility="Hidden"
- VerticalScrollBarVisibility="{TemplateBinding VerticalScrollBarVisibility}" />
- <Path x:Name="PART_ErrorPath" Grid.Column="1" Visibility="Collapsed" Margin="2,0,5,0"
- Data="{StaticResource Error}" Stretch="Uniform"
- Width="15" Fill="{TemplateBinding ErrorBackground}" />
- <ZUI:Poptip StaysOpen="True" PlacementTarget="{Binding ElementName=Border}"
- IsOpen="{Binding IsShowErrorTip, Mode=OneWay, RelativeSource={RelativeSource Mode=TemplatedParent}}"
- Background="{TemplateBinding ErrorBackground}" PlacementEx="TopLeft" BorderThickness="0">
- <ContentPresenter Content="{TemplateBinding ErrorContent}"
- ContentTemplate="{TemplateBinding ErrorContentTemplate}"/>
- </ZUI:Poptip>
- </Grid>
-
- <!--<VisualStateManager.VisualStateGroups>
- <VisualStateGroup x:Name="CommonStates">
- <VisualState x:Name="Normal">
- <Storyboard>
- <ColorAnimation Duration="0:0:0.0" Storyboard.TargetName="Border"
- Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
- To="#ABADB3" />
- </Storyboard>
- </VisualState>
- <VisualState x:Name="InputError">
- <Storyboard>
- <ColorAnimation Duration="0:0:0.0" Storyboard.TargetName="Border"
- Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
- To="#E20000" />
- </Storyboard>
- </VisualState>
- </VisualStateGroup>
- </VisualStateManager.VisualStateGroups>-->
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="BorderBrush" Value="#5CADFF" />
- </Trigger>
- <Trigger Property="IsKeyboardFocused" Value="True">
- <Setter Property="BorderBrush" Value="Blue" />
- </Trigger>
- <Trigger Property="IsHasError" Value="True">
- <Setter Property="BorderBrush" Value="#E20000" />
- <Setter TargetName="PART_ErrorPath" Property="Visibility" Value="Visible" />
- </Trigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsHasError" Value="True" />
- <Condition Property="IsMouseOver" Value="False" />
- </MultiTrigger.Conditions>
- <Setter Property="BorderBrush" Value="#E20000" />
- </MultiTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsKeyboardFocused" Value="True" />
- <Condition Property="IsHasError" Value="False" />
- <Condition Property="IsMouseOver" Value="False" />
- </MultiTrigger.Conditions>
- <Setter Property="BorderBrush" Value="Blue" />
- </MultiTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Style.Triggers>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Background" Value="{StaticResource Color.Disabled.Background}" />
- </Trigger>
- </Style.Triggers>
- </Style>
- </ResourceDictionary>
|