|
@@ -4,12 +4,67 @@
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
xmlns:local="clr-namespace:PDF_Master.CustomControl"
|
|
|
+ xmlns:help="clr-namespace:PDF_Master.Helper"
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
d:DesignHeight="24"
|
|
|
d:DesignWidth="200"
|
|
|
Loaded="UserControl_Loaded"
|
|
|
mc:Ignorable="d">
|
|
|
- <Grid>
|
|
|
+ <UserControl.Resources>
|
|
|
+ <Style x:Key="WarkTextBoxStyle" TargetType="{x:Type TextBox}">
|
|
|
+ <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
|
|
|
+ <Setter Property="BorderBrush" Value="#FFABADB3"/>
|
|
|
+ <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
|
|
|
+ <Setter Property="BorderThickness" Value="1"/>
|
|
|
+ <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
|
|
|
+ <Setter Property="HorizontalContentAlignment" Value="Left"/>
|
|
|
+ <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
|
|
+ <Setter Property="AllowDrop" Value="True"/>
|
|
|
+ <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
|
|
|
+ <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
|
|
+ <Setter Property="Template">
|
|
|
+ <Setter.Value>
|
|
|
+ <ControlTemplate TargetType="{x:Type TextBox}">
|
|
|
+ <Border x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
|
|
|
+ <Grid >
|
|
|
+ <ScrollViewer x:Name="PART_ContentHost" Focusable="False" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
|
|
|
+ <TextBlock x:Name="WARKTEXT" Text="{TemplateBinding Tag}" Foreground="#7F2F2F2F" Visibility="Collapsed" Padding="8,6,0,0"/>
|
|
|
+ </Grid>
|
|
|
+ </Border>
|
|
|
+ <ControlTemplate.Triggers>
|
|
|
+ <Trigger Property="IsEnabled" Value="False">
|
|
|
+ <Setter Property="Opacity" TargetName="border" Value="0.56"/>
|
|
|
+ </Trigger>
|
|
|
+ <Trigger Property="IsMouseOver" Value="True">
|
|
|
+ <Setter Property="BorderBrush" TargetName="border" Value="#FF7EB4EA"/>
|
|
|
+ </Trigger>
|
|
|
+ <Trigger Property="IsKeyboardFocused" Value="True">
|
|
|
+ <Setter Property="BorderBrush" TargetName="border" Value="#FF569DE5"/>
|
|
|
+ </Trigger>
|
|
|
+ <MultiTrigger>
|
|
|
+ <MultiTrigger.Conditions>
|
|
|
+ <Condition Property="Text" Value=""/>
|
|
|
+ <Condition Property="IsFocused" Value="False"/>
|
|
|
+ </MultiTrigger.Conditions>
|
|
|
+ <Setter Property="Visibility" TargetName="WARKTEXT" Value="Visible"/>
|
|
|
+ </MultiTrigger>
|
|
|
+ </ControlTemplate.Triggers>
|
|
|
+ </ControlTemplate>
|
|
|
+ </Setter.Value>
|
|
|
+ </Setter>
|
|
|
+ <Style.Triggers>
|
|
|
+ <MultiTrigger>
|
|
|
+ <MultiTrigger.Conditions>
|
|
|
+ <Condition Property="IsInactiveSelectionHighlightEnabled" Value="True"/>
|
|
|
+ <Condition Property="IsSelectionActive" Value="False"/>
|
|
|
+ </MultiTrigger.Conditions>
|
|
|
+ <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
|
|
|
+ </MultiTrigger>
|
|
|
+ </Style.Triggers>
|
|
|
+ </Style>
|
|
|
+ </UserControl.Resources>
|
|
|
+
|
|
|
+ <Grid>
|
|
|
<ComboBox
|
|
|
x:Name="writableComboBox"
|
|
|
Grid.Column="1"
|
|
@@ -38,6 +93,8 @@
|
|
|
PreviewKeyDown="writableTextBox_PreviewKeyDown"
|
|
|
Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=Text}"
|
|
|
TextChanged="writableTextBox_TextChange"
|
|
|
- Visibility="Hidden" />
|
|
|
+ Visibility="Hidden" Style="{StaticResource WarkTextBoxStyle}" Tag="例如1,3-5,10">
|
|
|
+
|
|
|
+ </TextBox>
|
|
|
</Grid>
|
|
|
</UserControl>
|