mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
- Add Custom TextBox
This commit is contained in:
parent
7a0d675ea6
commit
b61f8e8a55
2 changed files with 896 additions and 1 deletions
|
|
@ -4,6 +4,900 @@
|
|||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
||||
xmlns:ui="http://schemas.modernwpf.com/2019">
|
||||
|
||||
<!-- Combo Box -->
|
||||
<Thickness x:Key="ComboBoxTopHeaderMargin">0,0,0,4</Thickness>
|
||||
<Thickness x:Key="ComboBoxPadding">12,6,0,6</Thickness>
|
||||
<Thickness x:Key="ComboBoxEditableTextPadding">11,5,32,6</Thickness>
|
||||
<system:Double x:Key="ComboBoxMinHeight">32</system:Double>
|
||||
|
||||
<Style x:Key="DefaultComboBoxItemStyle" TargetType="ComboBoxItem">
|
||||
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackground}" />
|
||||
<Setter Property="KeyboardNavigation.TabNavigation" Value="Local" />
|
||||
<Setter Property="Padding" Value="{DynamicResource ComboBoxItemThemePadding}" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
|
||||
<Setter Property="ui:FocusVisualHelper.UseSystemFocusVisuals" Value="True" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBoxItem">
|
||||
<Border
|
||||
x:Name="LayoutRoot"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
SnapsToDevicePixels="True">
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
TextElement.Foreground="{TemplateBinding Foreground}" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsSelected" Value="False" />
|
||||
<Condition Property="IsMouseOver" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource ComboBoxItemBackgroundPointerOver}" />
|
||||
<Setter TargetName="LayoutRoot" Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushPointerOver}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ComboBoxItemForegroundPointerOver}" />
|
||||
</MultiTrigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsSelected" Value="False" />
|
||||
<Condition Property="IsEnabled" Value="False" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource ComboBoxItemBackgroundDisabled}" />
|
||||
<Setter TargetName="LayoutRoot" Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushDisabled}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ComboBoxItemForegroundDisabled}" />
|
||||
</MultiTrigger>
|
||||
<!-- Selected -->
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsSelected" Value="True" />
|
||||
<Condition Property="IsFocused" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource ComboBoxItemBackgroundSelected}" />
|
||||
<Setter TargetName="LayoutRoot" Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushSelected}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ComboBoxItemForegroundSelected}" />
|
||||
</MultiTrigger>
|
||||
<!-- SelectedUnfocused -->
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsSelected" Value="True" />
|
||||
<Condition Property="IsFocused" Value="False" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource ComboBoxItemBackgroundSelectedUnfocused}" />
|
||||
<Setter TargetName="LayoutRoot" Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushSelectedUnfocused}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ComboBoxItemForegroundSelectedUnfocused}" />
|
||||
</MultiTrigger>
|
||||
<!-- SelectedDisabled -->
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsSelected" Value="True" />
|
||||
<Condition Property="IsEnabled" Value="False" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource ComboBoxItemBackgroundSelectedDisabled}" />
|
||||
<Setter TargetName="LayoutRoot" Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushSelectedDisabled}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ComboBoxItemForegroundSelectedDisabled}" />
|
||||
</MultiTrigger>
|
||||
<!-- SelectedPointerOver -->
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsSelected" Value="True" />
|
||||
<Condition Property="IsMouseOver" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource ComboBoxItemBackgroundSelectedPointerOver}" />
|
||||
<Setter TargetName="LayoutRoot" Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushSelectedPointerOver}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ComboBoxItemForegroundSelectedPointerOver}" />
|
||||
</MultiTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style BasedOn="{StaticResource DefaultComboBoxItemStyle}" TargetType="ComboBoxItem" />
|
||||
|
||||
<Style x:Key="ComboBoxToggleButton" TargetType="ToggleButton">
|
||||
<Setter Property="OverridesDefaultStyle" Value="true" />
|
||||
<Setter Property="IsTabStop" Value="false" />
|
||||
<Setter Property="Focusable" Value="false" />
|
||||
<Setter Property="ClickMode" Value="Release" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Grid Background="{TemplateBinding Background}" SnapsToDevicePixels="True" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style
|
||||
x:Key="ComboBoxTextBoxStyle"
|
||||
BasedOn="{StaticResource DefaultTextBoxStyle}"
|
||||
TargetType="TextBox">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="TextBox">
|
||||
<Grid SnapsToDevicePixels="True">
|
||||
<Border
|
||||
x:Name="BorderElement"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}" />
|
||||
<ScrollViewer
|
||||
x:Name="PART_ContentHost"
|
||||
Margin="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
||||
IsTabStop="False"
|
||||
Style="{DynamicResource TextControlContentHostStyle}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" />
|
||||
<TextBlock
|
||||
x:Name="PlaceholderTextContentPresenter"
|
||||
Margin="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Foreground="{DynamicResource TextControlPlaceholderForeground}"
|
||||
IsHitTestVisible="False"
|
||||
Text="{TemplateBinding ui:ControlHelper.PlaceholderText}"
|
||||
TextAlignment="{TemplateBinding TextAlignment}"
|
||||
TextWrapping="{TemplateBinding TextWrapping}"
|
||||
Visibility="Collapsed" />
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="BorderElement" Property="Background" Value="{DynamicResource TextControlBackgroundDisabled}" />
|
||||
<Setter TargetName="BorderElement" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushDisabled}" />
|
||||
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundDisabled}" />
|
||||
<Setter TargetName="PlaceholderTextContentPresenter" Property="Foreground" Value="{DynamicResource TextControlPlaceholderForegroundDisabled}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="BorderElement" Property="Background" Value="{DynamicResource TextControlBackgroundPointerOver}" />
|
||||
<Setter TargetName="BorderElement" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushPointerOver}" />
|
||||
<Setter TargetName="PART_ContentHost" Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" />
|
||||
<Setter TargetName="PlaceholderTextContentPresenter" Property="Foreground" Value="{DynamicResource TextControlPlaceholderForegroundPointerOver}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelectionActive" Value="True">
|
||||
<Setter TargetName="BorderElement" Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
|
||||
<Setter TargetName="BorderElement" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
|
||||
<Setter TargetName="BorderElement" Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />
|
||||
<Setter Property="CaretBrush" Value="{DynamicResource TextControlForegroundFocused}" />
|
||||
<Setter TargetName="PlaceholderTextContentPresenter" Property="Foreground" Value="{DynamicResource TextControlPlaceholderForegroundFocused}" />
|
||||
</Trigger>
|
||||
<Trigger Property="Text" Value="">
|
||||
<Setter TargetName="PlaceholderTextContentPresenter" Property="Visibility" Value="Visible" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="DefaultComboBoxStyle" TargetType="ComboBox">
|
||||
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||
<Setter Property="Padding" Value="{DynamicResource ComboBoxPadding}" />
|
||||
<Setter Property="MaxDropDownHeight" Value="504" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource ComboBoxBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource ComboBoxBorderThemeThickness}" />
|
||||
<Setter Property="KeyboardNavigation.TabNavigation" Value="Once" />
|
||||
<Setter Property="ui:ComboBoxHelper.TextBoxStyle" Value="{StaticResource ComboBoxTextBoxStyle}" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="true" />
|
||||
<Setter Property="ScrollViewer.PanningMode" Value="Both" />
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="ui:ControlHelper.PlaceholderForeground" Value="{DynamicResource ComboBoxPlaceHolderForeground}" />
|
||||
<Setter Property="ui:FocusVisualHelper.UseSystemFocusVisuals" Value="{DynamicResource IsApplicationFocusVisualKindReveal}" />
|
||||
<Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
|
||||
<Setter Property="ui:ComboBoxHelper.KeepInteriorCornersSquare" Value="True" />
|
||||
<Setter Property="ui:ControlHelper.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
|
||||
<Setter Property="Validation.ErrorTemplate" Value="{DynamicResource TextControlValidationErrorTemplate}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBox">
|
||||
<ControlTemplate.Resources>
|
||||
<StreamGeometry x:Key="ChevronDown">M 18.935547 4.560547 L 19.814453 5.439453 L 10 15.253906 L 0.185547 5.439453 L 1.064453 4.560547 L 10 13.496094 Z</StreamGeometry>
|
||||
</ControlTemplate.Resources>
|
||||
|
||||
<Grid x:Name="LayoutRoot" SnapsToDevicePixels="True">
|
||||
<Grid.Resources>
|
||||
<Storyboard x:Key="OverlayOpeningAnimation">
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Shdw" Storyboard.TargetProperty="Opacity">
|
||||
<DiscreteDoubleKeyFrame KeyTime="0:0:0" Value="0.0" />
|
||||
<SplineDoubleKeyFrame
|
||||
KeySpline="0.1,0.9 0.2,1.0"
|
||||
KeyTime="0:0:0.383"
|
||||
Value="1.0" />
|
||||
</DoubleAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</Grid.Resources>
|
||||
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="32" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<ui:ContentPresenterEx
|
||||
x:Name="HeaderContentPresenter"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="{DynamicResource ComboBoxTopHeaderMargin}"
|
||||
VerticalAlignment="Top"
|
||||
Content="{TemplateBinding ui:ControlHelper.Header}"
|
||||
ContentTemplate="{TemplateBinding ui:ControlHelper.HeaderTemplate}"
|
||||
FlowDirection="{TemplateBinding FlowDirection}"
|
||||
FontWeight="{DynamicResource ComboBoxHeaderThemeFontWeight}"
|
||||
Foreground="{DynamicResource ComboBoxHeaderForeground}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
TextWrapping="Wrap"
|
||||
Visibility="{TemplateBinding ui:ControlHelper.HeaderVisibility}" />
|
||||
<Border
|
||||
x:Name="Background"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
MinWidth="{DynamicResource ComboBoxThemeMinWidth}"
|
||||
ui:ValidationHelper.IsTemplateValidationAdornerSite="True"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}" />
|
||||
<Border
|
||||
x:Name="HighlightBackground"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="{DynamicResource ComboBoxBackgroundUnfocused}"
|
||||
BorderBrush="{DynamicResource ComboBoxBackgroundBorderBrushUnfocused}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
|
||||
Opacity="0" />
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding SelectionBoxItem}"
|
||||
ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}"
|
||||
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
|
||||
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
<TextBlock
|
||||
x:Name="PlaceholderTextBlock"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
Padding="0,0,32,0"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Foreground="{TemplateBinding ui:ControlHelper.PlaceholderForeground}"
|
||||
IsHitTestVisible="False"
|
||||
Text="{TemplateBinding ui:ControlHelper.PlaceholderText}"
|
||||
Visibility="Collapsed" />
|
||||
<ToggleButton
|
||||
x:Name="ToggleButton"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="Transparent"
|
||||
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Style="{StaticResource ComboBoxToggleButton}" />
|
||||
<TextBox
|
||||
x:Name="PART_EditableTextBox"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="0,0,0,0"
|
||||
Padding="{DynamicResource ComboBoxEditableTextPadding}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
ui:ControlHelper.CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
|
||||
ui:ControlHelper.PlaceholderForeground="{TemplateBinding ui:ControlHelper.PlaceholderForeground}"
|
||||
ui:ControlHelper.PlaceholderText="{TemplateBinding ui:ControlHelper.PlaceholderText}"
|
||||
AutomationProperties.Name="{TemplateBinding AutomationProperties.Name}"
|
||||
BorderBrush="Transparent"
|
||||
IsReadOnly="{TemplateBinding IsReadOnly}"
|
||||
Style="{TemplateBinding ui:ComboBoxHelper.TextBoxStyle}"
|
||||
Visibility="Collapsed" />
|
||||
<ToggleButton
|
||||
x:Name="DropDownOverlay"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="30"
|
||||
Margin="0,1,1,1"
|
||||
HorizontalAlignment="Right"
|
||||
Background="Transparent"
|
||||
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Style="{StaticResource ComboBoxToggleButton}"
|
||||
Visibility="Collapsed" />
|
||||
<ui:FontIconFallback
|
||||
x:Name="DropDownGlyph"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
MinHeight="{DynamicResource ComboBoxMinHeight}"
|
||||
Margin="0,0,10,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Data="{StaticResource ChevronDown}"
|
||||
FontFamily="{DynamicResource SymbolThemeFontFamily}"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource ComboBoxDropDownGlyphForeground}"
|
||||
IsHitTestVisible="False" />
|
||||
<ContentPresenter
|
||||
x:Name="DescriptionPresenter"
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Content="{TemplateBinding ui:ControlHelper.Description}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
TextElement.Foreground="{DynamicResource SystemControlDescriptionTextForegroundBrush}"
|
||||
Visibility="{TemplateBinding ui:ControlHelper.DescriptionVisibility}" />
|
||||
<Popup
|
||||
x:Name="PART_Popup"
|
||||
AllowsTransparency="True"
|
||||
IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Placement="Bottom"
|
||||
PlacementTarget="{Binding ElementName=Background}"
|
||||
PopupAnimation="None">
|
||||
<Popup.PlacementRectangle>
|
||||
<MultiBinding>
|
||||
<MultiBinding.Converter>
|
||||
<ui:PlacementRectangleConverter Margin="0,1,0,1" />
|
||||
</MultiBinding.Converter>
|
||||
<Binding ElementName="Background" Path="ActualWidth" />
|
||||
<Binding ElementName="Background" Path="ActualHeight" />
|
||||
</MultiBinding>
|
||||
</Popup.PlacementRectangle>
|
||||
<ui:ThemeShadowChrome
|
||||
x:Name="Shdw"
|
||||
MinWidth="{Binding ActualWidth, ElementName=LayoutRoot}"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}"
|
||||
ui:OpeningAnimationHelper.Storyboard="{StaticResource OverlayOpeningAnimation}"
|
||||
CornerRadius="{Binding ElementName=PopupBorder, Path=CornerRadius}"
|
||||
IsShadowEnabled="{DynamicResource {x:Static SystemParameters.DropShadowKey}}">
|
||||
<Border
|
||||
x:Name="PopupBorder"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="{DynamicResource ComboBoxDropDownBackground}"
|
||||
CornerRadius="{DynamicResource OverlayCornerRadius}">
|
||||
<Border
|
||||
Padding="{DynamicResource ComboBoxDropdownBorderPadding}"
|
||||
BorderBrush="{DynamicResource ComboBoxDropDownBorderBrush}"
|
||||
BorderThickness="{DynamicResource ComboBoxDropdownBorderThickness}"
|
||||
CornerRadius="{Binding ElementName=PopupBorder, Path=CornerRadius}">
|
||||
<ScrollViewer
|
||||
x:Name="ScrollViewer"
|
||||
Foreground="{DynamicResource ComboBoxDropDownForeground}"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
|
||||
<ItemsPresenter
|
||||
Margin="{DynamicResource ComboBoxDropdownContentMargin}"
|
||||
KeyboardNavigation.DirectionalNavigation="Contained"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</Border>
|
||||
</ui:ThemeShadowChrome>
|
||||
</Popup>
|
||||
</Grid>
|
||||
|
||||
<ControlTemplate.Triggers>
|
||||
<!-- PointerOver -->
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Background" Property="Background" Value="{DynamicResource ComboBoxBackgroundPointerOver}" />
|
||||
<Setter TargetName="Background" Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrushPointerOver}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ComboBoxForegroundPointerOver}" />
|
||||
<Setter TargetName="PlaceholderTextBlock" Property="Foreground" Value="{DynamicResource ComboBoxPlaceHolderForegroundPointerOver}" />
|
||||
</Trigger>
|
||||
<!-- Pressed -->
|
||||
<Trigger SourceName="ToggleButton" Property="IsPressed" Value="True">
|
||||
<Setter TargetName="Background" Property="Background" Value="{DynamicResource ComboBoxBackgroundPressed}" />
|
||||
<Setter TargetName="Background" Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrushPressed}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ComboBoxForegroundPressed}" />
|
||||
<Setter TargetName="PlaceholderTextBlock" Property="Foreground" Value="{DynamicResource ComboBoxPlaceHolderForegroundPressed}" />
|
||||
</Trigger>
|
||||
<!-- Disabled -->
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="Background" Property="Background" Value="{DynamicResource ComboBoxBackgroundDisabled}" />
|
||||
<Setter TargetName="Background" Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrushDisabled}" />
|
||||
<Setter TargetName="HeaderContentPresenter" Property="Foreground" Value="{DynamicResource ComboBoxHeaderForegroundDisabled}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ComboBoxForegroundDisabled}" />
|
||||
<Setter TargetName="PlaceholderTextBlock" Property="Foreground" Value="{DynamicResource ComboBoxPlaceHolderForegroundDisabled}" />
|
||||
<Setter TargetName="DropDownGlyph" Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForegroundDisabled}" />
|
||||
</Trigger>
|
||||
|
||||
<!-- Focused -->
|
||||
<Trigger Property="ui:FocusVisualHelper.ShowFocusVisual" Value="True">
|
||||
<Setter TargetName="HighlightBackground" Property="Opacity" Value="1" />
|
||||
<Setter TargetName="HighlightBackground" Property="Background" Value="{DynamicResource ComboBoxBackgroundFocused}" />
|
||||
<Setter TargetName="HighlightBackground" Property="BorderBrush" Value="{DynamicResource ComboBoxBackgroundBorderBrushFocused}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ComboBoxForegroundFocused}" />
|
||||
<Setter TargetName="PlaceholderTextBlock" Property="Foreground" Value="{DynamicResource ComboBoxPlaceHolderForegroundFocused}" />
|
||||
<Setter TargetName="DropDownGlyph" Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForegroundFocused}" />
|
||||
</Trigger>
|
||||
<!-- FocusedPressed -->
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="ui:FocusVisualHelper.ShowFocusVisual" Value="True" />
|
||||
<Condition SourceName="ToggleButton" Property="IsPressed" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="HighlightBackground" Property="Opacity" Value="1" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource ComboBoxForegroundFocusedPressed}" />
|
||||
<Setter TargetName="PlaceholderTextBlock" Property="Foreground" Value="{DynamicResource ComboBoxPlaceHolderForegroundFocusedPressed}" />
|
||||
<Setter TargetName="DropDownGlyph" Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForegroundFocusedPressed}" />
|
||||
</MultiTrigger>
|
||||
<!-- FocusedDropDown -->
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="ui:FocusVisualHelper.ShowFocusVisual" Value="True" />
|
||||
<Condition Property="IsDropDownOpen" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="PopupBorder" Property="Visibility" Value="Visible" />
|
||||
</MultiTrigger>
|
||||
|
||||
<Trigger Property="IsEditable" Value="true">
|
||||
<Setter TargetName="ContentPresenter" Property="Visibility" Value="Collapsed" />
|
||||
<Setter TargetName="ToggleButton" Property="Visibility" Value="Collapsed" />
|
||||
<Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible" />
|
||||
<Setter TargetName="DropDownOverlay" Property="Visibility" Value="Visible" />
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsEditable" Value="False" />
|
||||
<Condition Property="SelectedIndex" Value="-1" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="PlaceholderTextBlock" Property="Visibility" Value="Visible" />
|
||||
</MultiTrigger>
|
||||
|
||||
<!-- TextBoxFocused -->
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition SourceName="PART_EditableTextBox" Property="IsSelectionActive" Value="True" />
|
||||
<Condition SourceName="DropDownOverlay" Property="IsMouseOver" Value="False" />
|
||||
<Condition SourceName="DropDownOverlay" Property="IsPressed" Value="False" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="DropDownGlyph" Property="Foreground" Value="{DynamicResource ComboBoxEditableDropDownGlyphForeground}" />
|
||||
<Setter TargetName="DropDownOverlay" Property="Margin" Value="0,2,2,2" />
|
||||
</MultiTrigger>
|
||||
<!-- TextBoxFocusedOverlayPointerOver -->
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition SourceName="PART_EditableTextBox" Property="IsSelectionActive" Value="True" />
|
||||
<Condition SourceName="DropDownOverlay" Property="IsMouseOver" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="DropDownGlyph" Property="Foreground" Value="{DynamicResource ComboBoxEditableDropDownGlyphForeground}" />
|
||||
<Setter TargetName="DropDownOverlay" Property="Background" Value="{DynamicResource ComboBoxFocusedDropDownBackgroundPointerOver}" />
|
||||
<Setter TargetName="DropDownOverlay" Property="Margin" Value="0,2,2,2" />
|
||||
</MultiTrigger>
|
||||
<!-- TextBoxFocusedOverlayPressed -->
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition SourceName="PART_EditableTextBox" Property="IsSelectionActive" Value="True" />
|
||||
<Condition SourceName="DropDownOverlay" Property="IsPressed" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="DropDownGlyph" Property="Foreground" Value="{DynamicResource ComboBoxEditableDropDownGlyphForeground}" />
|
||||
<Setter TargetName="DropDownOverlay" Property="Background" Value="{DynamicResource ComboBoxFocusedDropDownBackgroundPointerPressed}" />
|
||||
<Setter TargetName="DropDownOverlay" Property="Margin" Value="0,2,2,2" />
|
||||
</MultiTrigger>
|
||||
<!-- TextBoxOverlayPointerOver -->
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition SourceName="PART_EditableTextBox" Property="IsSelectionActive" Value="False" />
|
||||
<Condition SourceName="DropDownOverlay" Property="IsMouseOver" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="DropDownOverlay" Property="Background" Value="{DynamicResource ComboBoxDropDownBackgroundPointerOver}" />
|
||||
</MultiTrigger>
|
||||
<!-- TextBoxOverlayPressed -->
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition SourceName="PART_EditableTextBox" Property="IsSelectionActive" Value="False" />
|
||||
<Condition SourceName="DropDownOverlay" Property="IsPressed" Value="True" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter TargetName="DropDownOverlay" Property="Background" Value="{DynamicResource ComboBoxDropDownBackgroundPointerPressed}" />
|
||||
</MultiTrigger>
|
||||
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsGrouping" Value="true" />
|
||||
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="false" />
|
||||
</MultiTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style BasedOn="{StaticResource DefaultComboBoxStyle}" TargetType="ComboBox" />
|
||||
|
||||
<Style
|
||||
x:Key="DataGridComboBoxStyle"
|
||||
BasedOn="{StaticResource DefaultComboBoxStyle}"
|
||||
TargetType="ComboBox">
|
||||
<Setter Property="Padding" Value="12,0,0,0" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="ui:ControlHelper.CornerRadius" Value="0" />
|
||||
<Setter Property="Validation.ErrorTemplate" Value="{DynamicResource DataGridTextControlValidationErrorTemplate}" />
|
||||
</Style>
|
||||
|
||||
<Style
|
||||
x:Key="DataGridTextBlockComboBoxStyle"
|
||||
BasedOn="{StaticResource DefaultComboBoxStyle}"
|
||||
TargetType="ComboBox">
|
||||
<Setter Property="Padding" Value="12,0,0,0" />
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBox">
|
||||
<ContentPresenter
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding SelectionBoxItem}"
|
||||
ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}"
|
||||
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
|
||||
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
|
||||
IsHitTestVisible="false"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- Text Box -->
|
||||
<Thickness x:Key="TextBoxTopHeaderMargin">0,0,0,4</Thickness>
|
||||
<ui:CornerRadiusFilterConverter x:Key="RightCornerRadiusFilterConverter" Filter="Right" />
|
||||
<Style x:Key="DefaultTextBoxStyle" TargetType="TextBox">
|
||||
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" />
|
||||
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" />
|
||||
<Setter Property="SelectionBrush" Value="{DynamicResource TextControlSelectionHighlightColor}" />
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" />
|
||||
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
|
||||
<Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False" />
|
||||
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Top" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource TextControlThemeMinHeight}" />
|
||||
<Setter Property="MinWidth" Value="{DynamicResource TextControlThemeMinWidth}" />
|
||||
<Setter Property="Padding" Value="{DynamicResource TextControlThemePadding}" />
|
||||
<Setter Property="ui:ControlHelper.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
|
||||
<Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
||||
<Setter Property="AllowDrop" Value="true" />
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
|
||||
<Setter Property="ContextMenu" Value="{DynamicResource TextControlContextMenu}" />
|
||||
<Setter Property="ui:TextContextMenu.UsingTextContextMenu" Value="True" />
|
||||
<Setter Property="ui:TextBoxHelper.IsEnabled" Value="True" />
|
||||
<Setter Property="Validation.ErrorTemplate" Value="{DynamicResource TextControlValidationErrorTemplate}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="TextBox">
|
||||
<ControlTemplate.Resources>
|
||||
<Style x:Key="DeleteButtonStyle" TargetType="Button">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<ControlTemplate.Resources>
|
||||
<StreamGeometry x:Key="Cancel">M 10.888672 10 L 17.626953 16.748047 L 16.748047 17.626953 L 10 10.888672 L 3.251953 17.626953 L 2.373047 16.748047 L 9.111328 10 L 2.373047 3.251953 L 3.251953 2.373047 L 10 9.111328 L 16.748047 2.373047 L 17.626953 3.251953 Z</StreamGeometry>
|
||||
</ControlTemplate.Resources>
|
||||
<Border
|
||||
x:Name="ButtonLayoutGrid"
|
||||
Background="{DynamicResource TextControlButtonBackground}"
|
||||
BorderBrush="{DynamicResource TextControlButtonBorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}">
|
||||
<ui:FontIconFallback
|
||||
x:Name="GlyphElement"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Data="{StaticResource Cancel}"
|
||||
FontFamily="{DynamicResource SymbolThemeFontFamily}"
|
||||
FontSize="12"
|
||||
FontStyle="Normal"
|
||||
Foreground="{DynamicResource TextControlButtonForeground}" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter TargetName="ButtonLayoutGrid" Property="Background" Value="{DynamicResource TextControlButtonBackgroundPointerOver}" />
|
||||
<Setter TargetName="ButtonLayoutGrid" Property="BorderBrush" Value="{DynamicResource TextControlButtonBorderBrushPointerOver}" />
|
||||
<Setter TargetName="GlyphElement" Property="Foreground" Value="{DynamicResource TextControlButtonForegroundPointerOver}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="true">
|
||||
<Setter TargetName="ButtonLayoutGrid" Property="Background" Value="{DynamicResource TextControlButtonBackgroundPressed}" />
|
||||
<Setter TargetName="ButtonLayoutGrid" Property="BorderBrush" Value="{DynamicResource TextControlButtonBorderBrushPressed}" />
|
||||
<Setter TargetName="GlyphElement" Property="Foreground" Value="{DynamicResource TextControlButtonForegroundPressed}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter TargetName="ButtonLayoutGrid" Property="Opacity" Value="0" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ControlTemplate.Resources>
|
||||
<Grid SnapsToDevicePixels="True">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:ContentPresenterEx
|
||||
x:Name="HeaderContentPresenter"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="{DynamicResource TextBoxTopHeaderMargin}"
|
||||
VerticalAlignment="Top"
|
||||
Content="{TemplateBinding ui:ControlHelper.Header}"
|
||||
ContentTemplate="{TemplateBinding ui:ControlHelper.HeaderTemplate}"
|
||||
FontWeight="Normal"
|
||||
Foreground="{DynamicResource TextControlHeaderForeground}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
TextWrapping="Wrap"
|
||||
Visibility="{TemplateBinding ui:ControlHelper.HeaderVisibility}" />
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Grid.RowSpan="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="#fbfbfb"
|
||||
BorderBrush="#e5e5e5"
|
||||
BorderThickness="1,1,1,1"
|
||||
CornerRadius="4">
|
||||
<Border
|
||||
x:Name="BorderElement"
|
||||
MinWidth="{TemplateBinding MinWidth}"
|
||||
MinHeight="{TemplateBinding MinHeight}"
|
||||
ui:ValidationHelper.IsTemplateValidationAdornerSite="True"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="#868686"
|
||||
BorderThickness="0,0,0,1"
|
||||
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}" />
|
||||
</Border>
|
||||
<ScrollViewer
|
||||
x:Name="PART_ContentHost"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Focusable="False"
|
||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
|
||||
IsTabStop="False"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
Style="{DynamicResource TextControlContentHostStyle}"
|
||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" />
|
||||
<TextBlock
|
||||
x:Name="PlaceholderTextContentPresenter"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Foreground="{TemplateBinding ui:ControlHelper.PlaceholderForeground}"
|
||||
IsHitTestVisible="False"
|
||||
Text="{TemplateBinding ui:ControlHelper.PlaceholderText}"
|
||||
TextAlignment="{TemplateBinding TextAlignment}"
|
||||
TextWrapping="{TemplateBinding TextWrapping}" />
|
||||
<Button
|
||||
x:Name="DeleteButton"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
MinWidth="34"
|
||||
Padding="{DynamicResource HelperButtonThemePadding}"
|
||||
VerticalAlignment="Stretch"
|
||||
ui:ControlHelper.CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius,
|
||||
Converter={StaticResource RightCornerRadiusFilterConverter}}"
|
||||
ui:TextBoxHelper.IsDeleteButton="True"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Focusable="False"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
IsTabStop="False"
|
||||
Style="{StaticResource DeleteButtonStyle}"
|
||||
Visibility="Collapsed" />
|
||||
<ContentPresenter
|
||||
x:Name="DescriptionPresenter"
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Content="{TemplateBinding ui:ControlHelper.Description}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
TextElement.Foreground="{DynamicResource SystemControlDescriptionTextForegroundBrush}"
|
||||
Visibility="{TemplateBinding ui:ControlHelper.DescriptionVisibility}" />
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup x:Name="ButtonStates">
|
||||
<VisualState x:Name="ButtonVisible">
|
||||
<Storyboard>
|
||||
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="DeleteButton" Storyboard.TargetProperty="Visibility">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
</Storyboard>
|
||||
</VisualState>
|
||||
<VisualState x:Name="ButtonCollapsed" />
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="ui:ControlHelper.PlaceholderForeground" Value="{x:Null}">
|
||||
<Setter TargetName="PlaceholderTextContentPresenter" Property="Foreground" Value="{DynamicResource TextControlPlaceholderForeground}" />
|
||||
</Trigger>
|
||||
<Trigger Property="ui:TextBoxHelper.HasText" Value="True">
|
||||
<Setter TargetName="PlaceholderTextContentPresenter" Property="Visibility" Value="Collapsed" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter TargetName="HeaderContentPresenter" Property="Foreground" Value="{DynamicResource TextControlHeaderForegroundDisabled}" />
|
||||
<Setter Property="Background" Value="{DynamicResource TextControlBackgroundDisabled}" />
|
||||
<Setter TargetName="BorderElement" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushDisabled}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundDisabled}" />
|
||||
<Setter TargetName="PlaceholderTextContentPresenter" Property="Foreground" Value="{DynamicResource TextControlPlaceholderForegroundDisabled}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter TargetName="BorderElement" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushPointerOver}" />
|
||||
<Setter Property="Background" Value="#f6f6f6" />
|
||||
<Setter TargetName="PlaceholderTextContentPresenter" Property="Foreground" Value="{DynamicResource TextControlPlaceholderForegroundPointerOver}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelectionActive" Value="true">
|
||||
<Setter TargetName="PlaceholderTextContentPresenter" Property="Foreground" Value="{DynamicResource TextControlPlaceholderForegroundFocused}" />
|
||||
<Setter Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" />
|
||||
<Setter TargetName="BorderElement" Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" />
|
||||
<Setter TargetName="BorderElement" Property="BorderThickness" Value="0,0,0,2" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />
|
||||
</Trigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsKeyboardFocused" Value="True" />
|
||||
<Condition Property="ui:TextBoxHelper.HasText" Value="True" />
|
||||
<Condition Property="IsReadOnly" Value="False" />
|
||||
<Condition Property="AcceptsReturn" Value="False" />
|
||||
<Condition Property="TextWrapping" Value="NoWrap" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="ui:TextBoxHelper.IsDeleteButtonVisible" Value="True" />
|
||||
</MultiTrigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style BasedOn="{StaticResource DefaultTextBoxStyle}" TargetType="TextBox" />
|
||||
|
||||
<Style
|
||||
x:Key="DataGridTextBoxStyle"
|
||||
BasedOn="{StaticResource DefaultTextBoxStyle}"
|
||||
TargetType="TextBox">
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
<Setter Property="Padding" Value="11,0,6,0" />
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="ui:ControlHelper.CornerRadius" Value="0" />
|
||||
<Setter Property="Validation.ErrorTemplate" Value="{DynamicResource DataGridTextControlValidationErrorTemplate}" />
|
||||
</Style>
|
||||
|
||||
<!-- Button -->
|
||||
<Thickness x:Key="ButtonPadding">8,5,8,6</Thickness>
|
||||
<Style x:Key="DefaultButtonStyle" TargetType="Button">
|
||||
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThemeThickness}" />
|
||||
<Setter Property="Padding" Value="{StaticResource ButtonPadding}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontWeight" Value="Normal" />
|
||||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
|
||||
<Setter Property="ui:FocusVisualHelper.UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
|
||||
<Setter Property="ui:FocusVisualHelper.FocusVisualMargin" Value="-3" />
|
||||
<Setter Property="ui:ControlHelper.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
|
||||
<Setter Property="Stylus.IsPressAndHoldEnabled" Value="False" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border
|
||||
x:Name="Background"
|
||||
Background="#fefefe"
|
||||
BorderBrush="#e5e5e5"
|
||||
BorderThickness="1,1,1,0"
|
||||
CornerRadius="4"
|
||||
SnapsToDevicePixels="True">
|
||||
<Border
|
||||
x:Name="Border"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
BorderBrush="#d3d3d3"
|
||||
BorderThickness="0,0,0,2"
|
||||
CornerRadius="4">
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Focusable="False"
|
||||
RecognizesAccessKey="True"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</Border>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Background" Property="Background" Value="#f6f6f6" />
|
||||
<Setter TargetName="Background" Property="BorderThickness" Value="1,1,1,0" />
|
||||
<Setter TargetName="Background" Property="BorderBrush" Value="#e5e5e5" />
|
||||
<Setter TargetName="Border" Property="BorderBrush" Value="#d3d3d3" />
|
||||
<Setter TargetName="Border" Property="BorderThickness" Value="0,0,0,2" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="Background" Property="Background" Value="#f6f6f6" />
|
||||
<Setter TargetName="Background" Property="BorderThickness" Value="1,1,1,1" />
|
||||
<Setter TargetName="Background" Property="BorderBrush" Value="#e5e5e5" />
|
||||
<Setter TargetName="Border" Property="BorderBrush" Value="#f6f6f6" />
|
||||
<Setter TargetName="Border" Property="BorderThickness" Value="0,0,0,1" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="#5d5d5d" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="Background" Property="Background" Value="#f6f6f6" />
|
||||
<Setter TargetName="Background" Property="BorderThickness" Value="1,1,1,1" />
|
||||
<Setter TargetName="Background" Property="BorderBrush" Value="#e5e5e5" />
|
||||
<Setter TargetName="Border" Property="BorderBrush" Value="#f6f6f6" />
|
||||
<Setter TargetName="Border" Property="BorderThickness" Value="0,0,0,1" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="#9d9d9d" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style BasedOn="{StaticResource DefaultButtonStyle}" TargetType="Button" />
|
||||
|
||||
<!-- - Custom Toggle Switch from modern wpf for left label -->
|
||||
<system:TimeSpan x:Key="RepositionDelay">0:0:0.033</system:TimeSpan>
|
||||
<KeyTime x:Key="RepositionDuration">0:0:0.367</KeyTime>
|
||||
|
|
|
|||
|
|
@ -685,9 +685,10 @@
|
|||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="300"
|
||||
Height="26"
|
||||
Height="34"
|
||||
Text="{Binding Settings.PluginSettings.PythonDirectory, TargetNullValue='No Setting'}" />
|
||||
<Button
|
||||
Height="34"
|
||||
Margin="10,10,18,10"
|
||||
Click="OnSelectPythonDirectoryClick"
|
||||
Content="{DynamicResource selectPythonDirectory}" />
|
||||
|
|
|
|||
Loading…
Reference in a new issue