123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <ResourceDictionary
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:wpf="clr-namespace:FWindSoft.Wpf"
- xmlns:local="clr-namespace:FWindSoft.Wpf.Controls">
- <Style TargetType="{x:Type local:TextBoxEditor}">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
- <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
- <Setter Property="BorderBrush" Value="Black"/>
- <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:TextBoxEditor}">
- <ControlTemplate.Resources>
- <Style TargetType="{x:Type Button}">
- <!--<Setter Property="BorderThickness" Value="1"></Setter>-->
- <!--<Setter Property="BorderBrush" Value="Black"></Setter>-->
- <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 x:Name="Show" HorizontalAlignment="Stretch" Visibility="Visible">
- <Grid.ColumnDefinitions>
- <ColumnDefinition></ColumnDefinition>
- <ColumnDefinition Width="Auto"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <TextBlock Name="PART_TextShow" VerticalAlignment="Center" Text="{TemplateBinding Property=Text}" ></TextBlock>
- <StackPanel Name="Stack" Grid.Column="1" Orientation="Horizontal" >
- <Button Name="BtnUpdate" Content="{wpf:FontIcon Icon=Pencil}" BorderThickness="0" FontFamily="{DynamicResource ResourceKey={x:Static wpf:FontsUtil.AwesomeKey}}" Width="30" FontSize="20" ></Button>
- </StackPanel>
- </Grid>
- <Grid x:Name="Editing" HorizontalAlignment="Stretch" Visibility="Collapsed">
- <Grid.ColumnDefinitions>
- <ColumnDefinition></ColumnDefinition>
- <ColumnDefinition Width="Auto"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <TextBox x:Name="PART_ContentHost" VerticalAlignment="Stretch" VerticalContentAlignment="Center" Text="{Binding Text,RelativeSource={RelativeSource TemplatedParent}}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- <StackPanel Name="StackEdit" Grid.Column="1" Orientation="Horizontal">
- <Button Name="BtnClear" Content="{wpf:FontIcon Icon=Times}" BorderThickness="0" FontFamily="{DynamicResource ResourceKey={x:Static wpf:FontsUtil.AwesomeKey}}" Width="30" FontSize="20" ></Button>
- <Button Name="BtnComplete" Content="{wpf:FontIcon Icon=Check}" BorderThickness="0" FontFamily="{DynamicResource ResourceKey={x:Static wpf:FontsUtil.AwesomeKey}}" Width="30" FontSize="20" Command="{TemplateBinding Command}" CommandParameter="{TemplateBinding CommandParameter}"></Button>
- </StackPanel>
- </Grid>
- </Grid>
- </Border>
-
-
- <ControlTemplate.Triggers>
- <Trigger Property="IsEditing" Value="True">
- <Setter Property="Visibility" TargetName="Show" Value="Collapsed"/>
- <Setter Property="Visibility" TargetName="Editing" Value="Visible" />
- </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.Triggers>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsInactiveSelectionHighlightEnabled" SourceName="PART_ContentHost" Value="true"/>
- <Condition Property="IsSelectionActive" Value="false"/>
- </MultiTrigger.Conditions>
- <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
- </MultiTrigger>
- </Style.Triggers>-->
- </Style>
- </ResourceDictionary>
|