| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <ResourceDictionary
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:local="clr-namespace:SAGA.DotNetUtils.WPF">
- <Style TargetType="{x:Type local:SearchInputEditor}">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
- <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
- <Setter Property="BorderBrush" Value="DarkGray"/>
- <Setter Property="BorderThickness" Value="1"/>
- <Setter Property="Padding" Value="1"/>
- <Setter Property="AllowDrop" Value="true"/>
- <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
- <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
- <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type local:SearchInputEditor}">
- <ControlTemplate.Resources>
- <Style TargetType="{x:Type Button}">
- <Setter Property="Background" Value="White"></Setter>
- <Setter Property="Opacity" Value="1"></Setter>
- <Setter Property="Padding" Value="5,0,5,0"></Setter>
- <Setter Property="HorizontalContentAlignment" Value="Center"></Setter>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate>
- <Border Name="Border" BorderThickness="{TemplateBinding Button.BorderThickness}" BorderBrush="{TemplateBinding Button.BorderBrush}" Background="{TemplateBinding Button.Background}" >
- <Grid Margin="{TemplateBinding Padding}" HorizontalAlignment="Stretch">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"></ColumnDefinition>
- <ColumnDefinition></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <ContentPresenter Grid.Column="1" Content="{TemplateBinding ContentControl.Content}" VerticalAlignment="Center" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"></ContentPresenter>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Background" Value="#FFCBC6C6"/>
- <Setter Property="BorderThickness" Value="1"></Setter>
- <Trigger.EnterActions>
- <BeginStoryboard>
- <Storyboard TargetName="Border">
- <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.5" Duration="0:0:1" />
- </Storyboard>
- </BeginStoryboard>
- </Trigger.EnterActions>
- <Trigger.ExitActions>
- <BeginStoryboard>
- <Storyboard TargetName="Border">
- <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:1" />
- </Storyboard>
- </BeginStoryboard>
- </Trigger.ExitActions>
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter Property="Button.Foreground" TargetName="Border" Value="Gray" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ControlTemplate.Resources>
- <Border Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
- <Grid >
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"></ColumnDefinition>
- <ColumnDefinition Width="*"></ColumnDefinition>
- <ColumnDefinition Width="Auto"></ColumnDefinition>
- <ColumnDefinition Width="Auto"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <Button Grid.Column="0" Name="BtnFlag" BorderThickness="0" Width="23" Height="23" VerticalAlignment="Center">
- <Button.Background>
- <ImageBrush>
- <ImageBrush.ImageSource>
- <BitmapImage UriSource="../Image/search.jpg"></BitmapImage>
- </ImageBrush.ImageSource>
- </ImageBrush>
- </Button.Background>
- </Button>
- <TextBox Grid.Column="1" x:Name="PART_ContentHost" BorderThickness="0" VerticalAlignment="Stretch" VerticalContentAlignment="Center" Text="{Binding Text,RelativeSource={RelativeSource TemplatedParent},Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- <TextBlock Visibility="Collapsed" Grid.Column="1" IsHitTestVisible="False" Name="PART_WaterTextShow" VerticalAlignment="Center" Text="{TemplateBinding Property=WaterText}" Foreground="Gray"></TextBlock>
- <Button Grid.Column="2" Name="BtnClear" BorderThickness="0" >
- <TextBlock Text="x" VerticalAlignment="Center" FontSize="12"></TextBlock>
- </Button>
- <Button Grid.Column="3" Name="BtnComplete" Content="{TemplateBinding CommandContent}" BorderThickness="0" Command="{TemplateBinding Command}" CommandParameter="{TemplateBinding CommandParameter}"></Button>
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="Text" Value="">
- <Setter Property="Visibility" TargetName="PART_WaterTextShow" Value="Visible"/>
- <Setter Property="Visibility" TargetName="BtnClear" Value="Collapsed" />
- </Trigger>
- <Trigger Property="Text" Value="x:Null">
- <Setter Property="Visibility" TargetName="PART_WaterTextShow" Value="Visible"/>
- <Setter Property="Visibility" TargetName="BtnClear" Value="Collapsed" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|