feat(style): add TextBox small style
This commit is contained in:
1 parent
875b7f0632
commit
19c9df125f
7 files changed
+113
-28
No files matched your search
@@ -6250,6 +6250,7 @@
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
||||
<Setter Property="AllowDrop" Value="true" />
|
||||
<Setter Property="Padding" Value="{StaticResource DefaultInputPadding}" />
|
||||
<Setter Property="hc:TitleElement.MarginOnTheLeft" Value="0,8,6,8" />
|
||||
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
@@ -6309,7 +6310,7 @@
|
||||
<ColumnDefinition Width="{Binding Path=(hc:InfoElement.TitleWidth),RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{Binding Path=(hc:TitleElement.MarginOnTheLeft),RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}" />
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</DockPanel>
|
||||
@@ -6371,7 +6372,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="{TemplateBinding Text,Converter={StaticResource String2VisibilityReConverter}}" HorizontalAlignment="Stretch" Style="{StaticResource TextBlockDefaultThiLight}" Text="{Binding Path=(hc:InfoElement.Placeholder),RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<ScrollViewer Margin="-2,0,-1,0" Grid.Column="0" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" />
|
||||
<Button Height="{x:Static system:Double.NaN}" Command="interactivity:ControlCommands.Clear" Margin="0,0,7,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="1" Style="{StaticResource ButtonIcon}" Padding="0,6" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{Binding BorderBrush,ElementName=templateRoot}" />
|
||||
<Button Height="{x:Static system:Double.NaN}" Command="interactivity:ControlCommands.Clear" Margin="0,0,7,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="1" Style="{StaticResource ButtonIcon}" Padding="0" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{Binding BorderBrush,ElementName=templateRoot}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
@@ -6418,7 +6419,7 @@
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Column="1" />
|
||||
<DockPanel LastChildFill="True" Grid.Column="0" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<DockPanel LastChildFill="True" Grid.Column="0" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{Binding Path=(hc:TitleElement.MarginOnTheLeft),RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}" />
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</DockPanel>
|
||||
@@ -6430,7 +6431,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="{TemplateBinding Text,Converter={StaticResource String2VisibilityReConverter}}" HorizontalAlignment="Stretch" Style="{StaticResource TextBlockDefaultThiLight}" Text="{Binding Path=(hc:InfoElement.Placeholder),RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<ScrollViewer Grid.Column="0" Margin="-2,0,-1,0" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" />
|
||||
<Button Height="{x:Static system:Double.NaN}" Command="interactivity:ControlCommands.Clear" Margin="0,0,7,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="1" Style="{StaticResource ButtonIcon}" Padding="0,6" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{Binding BorderBrush,ElementName=templateRoot}" />
|
||||
<Button Height="{x:Static system:Double.NaN}" Command="interactivity:ControlCommands.Clear" Margin="0,0,7,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="1" Style="{StaticResource ButtonIcon}" Padding="0" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{Binding BorderBrush,ElementName=templateRoot}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
@@ -6723,8 +6724,24 @@
|
||||
<Style BasedOn="{StaticResource ComboBoxPlusBaseStyle}" TargetType="hc:ComboBox" />
|
||||
<Style BasedOn="{StaticResource WatermarkTextBoxBaseStyle}" TargetType="hc:WatermarkTextBox" />
|
||||
<Style BasedOn="{StaticResource TextBoxBaseStyle}" TargetType="TextBox" />
|
||||
<Style x:Key="TextBox.Small" BasedOn="{StaticResource TextBoxBaseStyle}" TargetType="TextBox">
|
||||
<Setter Property="MinHeight" Value="20" />
|
||||
<Setter Property="Padding" Value="6,0" />
|
||||
</Style>
|
||||
<Style x:Key="TextBoxExtend" BasedOn="{StaticResource TextBoxExtendBaseStyle}" TargetType="TextBox" />
|
||||
<Style x:Key="TextBoxExtend.Small" BasedOn="{StaticResource TextBoxExtend}" TargetType="TextBox">
|
||||
<Setter Property="hc:InfoElement.MinContentHeight" Value="20" />
|
||||
<Setter Property="hc:InfoElement.ContentHeight" Value="20" />
|
||||
<Setter Property="hc:TitleElement.MarginOnTheLeft" Value="0,3,6,3" />
|
||||
<Setter Property="Padding" Value="6,0" />
|
||||
</Style>
|
||||
<Style BasedOn="{StaticResource TextBoxPlusBaseStyle}" TargetType="hc:TextBox" />
|
||||
<Style x:Key="TextBoxPlus.Small" BasedOn="{StaticResource TextBoxPlusBaseStyle}" TargetType="hc:TextBox">
|
||||
<Setter Property="hc:InfoElement.MinContentHeight" Value="20" />
|
||||
<Setter Property="hc:InfoElement.ContentHeight" Value="20" />
|
||||
<Setter Property="hc:TitleElement.MarginOnTheLeft" Value="0,3,6,3" />
|
||||
<Setter Property="Padding" Value="6,0" />
|
||||
</Style>
|
||||
<Style BasedOn="{StaticResource MenuItemBaseStyle}" TargetType="MenuItem" />
|
||||
<Style BasedOn="{StaticResource MenuBaseStyle}" TargetType="Menu" />
|
||||
<ControlTemplate x:Key="BadgeTextTemplate" TargetType="hc:Badge">
|
||||
|
||||
@@ -6,14 +6,25 @@
|
||||
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol">
|
||||
<hc:TransitioningContentControl>
|
||||
<StackPanel Margin="32">
|
||||
<hc:TextBox ShowClearButton="True" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
|
||||
<hc:TextBox Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" Margin="0,16,0,0" IsEnabled="False"/>
|
||||
<hc:UniformSpacingPanel Spacing="32" Margin="32" ChildWrapping="Wrap">
|
||||
<StackPanel>
|
||||
<hc:TextBox ShowClearButton="True" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
|
||||
<hc:TextBox Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" Margin="0,16,0,0" IsEnabled="False"/>
|
||||
|
||||
<hc:TextBox ShowClearButton="True" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
|
||||
<hc:TextBox TextType="Mail" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterEmail}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr2}}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
|
||||
<hc:TextBox Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
|
||||
<hc:TextBox ShowClearButton="True" Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
|
||||
</StackPanel>
|
||||
<hc:TextBox ShowClearButton="True" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
|
||||
<hc:TextBox TextType="Mail" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterEmail}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr2}}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
|
||||
<hc:TextBox Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
|
||||
<hc:TextBox ShowClearButton="True" Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<hc:TextBox ShowClearButton="True" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" Style="{StaticResource TextBoxPlus.Small}"/>
|
||||
<hc:TextBox Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" Margin="0,16,0,0" IsEnabled="False" Style="{StaticResource TextBoxPlus.Small}"/>
|
||||
|
||||
<hc:TextBox ShowClearButton="True" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" Style="{StaticResource TextBoxPlus.Small}"/>
|
||||
<hc:TextBox TextType="Mail" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterEmail}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr2}}" hc:InfoElement.Necessary="True" Margin="0,16,0,0" Style="{StaticResource TextBoxPlus.Small}"/>
|
||||
<hc:TextBox Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" Style="{StaticResource TextBoxPlus.Small}"/>
|
||||
<hc:TextBox ShowClearButton="True" Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" hc:InfoElement.Necessary="True" Margin="0,16,0,0" Style="{StaticResource TextBoxPlus.Small}"/>
|
||||
</StackPanel>
|
||||
</hc:UniformSpacingPanel>
|
||||
</hc:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -6,14 +6,25 @@
|
||||
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension"
|
||||
Background="{DynamicResource RegionBrush}">
|
||||
<hc:TransitioningContentControl>
|
||||
<StackPanel Margin="32">
|
||||
<TextBox Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
|
||||
<TextBox Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" Margin="0,16,0,0" IsEnabled="False"/>
|
||||
<hc:UniformSpacingPanel Spacing="32" Margin="32" ChildWrapping="Wrap">
|
||||
<StackPanel>
|
||||
<TextBox Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
|
||||
<TextBox Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" Margin="0,16,0,0" IsEnabled="False"/>
|
||||
|
||||
<TextBox hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Style="{StaticResource TextBoxExtend}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
|
||||
<TextBox hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr2}}" Style="{StaticResource TextBoxExtend}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
|
||||
<TextBox Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" Style="{StaticResource TextBoxExtend}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
|
||||
<TextBox Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" hc:InfoElement.Necessary="True" Style="{StaticResource TextBoxExtend}" Margin="0,16,0,0"/>
|
||||
</StackPanel>
|
||||
<TextBox hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Style="{StaticResource TextBoxExtend}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
|
||||
<TextBox hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr2}}" Style="{StaticResource TextBoxExtend}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
|
||||
<TextBox Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" Style="{StaticResource TextBoxExtend}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
|
||||
<TextBox Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" hc:InfoElement.Necessary="True" Style="{StaticResource TextBoxExtend}" Margin="0,16,0,0"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBox Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" Style="{StaticResource TextBox.Small}"/>
|
||||
<TextBox Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}" Margin="0,16,0,0" IsEnabled="False" Style="{StaticResource TextBox.Small}"/>
|
||||
|
||||
<TextBox hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr1}}" Style="{StaticResource TextBoxExtend.Small}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
|
||||
<TextBox hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr2}}" Style="{StaticResource TextBoxExtend.Small}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
|
||||
<TextBox Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" Style="{StaticResource TextBoxExtend.Small}" Margin="0,32,0,0" Text="{ex:Lang Key={x:Static langs:LangKeys.ContentDemoStr}}"/>
|
||||
<TextBox Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterContent}}" hc:InfoElement.TitlePlacement="Left" hc:InfoElement.Title="{ex:Lang Key={x:Static langs:LangKeys.TitleDemoStr3}}" hc:InfoElement.Necessary="True" Style="{StaticResource TextBoxExtend.Small}" Margin="0,16,0,0"/>
|
||||
</StackPanel>
|
||||
</hc:UniformSpacingPanel>
|
||||
</hc:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -75,5 +75,14 @@ namespace HandyControl.Controls
|
||||
|
||||
public static VerticalAlignment GetVerticalAlignment(DependencyObject element)
|
||||
=> (VerticalAlignment) element.GetValue(VerticalAlignmentProperty);
|
||||
|
||||
public static readonly DependencyProperty MarginOnTheLeftProperty = DependencyProperty.RegisterAttached(
|
||||
"MarginOnTheLeft", typeof(Thickness), typeof(TitleElement), new FrameworkPropertyMetadata(default(Thickness), FrameworkPropertyMetadataOptions.Inherits));
|
||||
|
||||
public static void SetMarginOnTheLeft(DependencyObject element, Thickness value)
|
||||
=> element.SetValue(MarginOnTheLeftProperty, value);
|
||||
|
||||
public static Thickness GetMarginOnTheLeft(DependencyObject element)
|
||||
=> (Thickness) element.GetValue(MarginOnTheLeftProperty);
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,7 @@
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="AllowDrop" Value="true"/>
|
||||
<Setter Property="Padding" Value="{StaticResource DefaultInputPadding}"/>
|
||||
<Setter Property="hc:TitleElement.MarginOnTheLeft" Value="0,8,6,8"/>
|
||||
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
@@ -98,7 +99,7 @@
|
||||
<ColumnDefinition Width="{Binding Path=(hc:InfoElement.TitleWidth),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{Binding Path=(hc:TitleElement.MarginOnTheLeft),RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
@@ -162,7 +163,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="{TemplateBinding Text,Converter={StaticResource String2VisibilityReConverter}}" HorizontalAlignment="Stretch" Style="{StaticResource TextBlockDefaultThiLight}" Text="{Binding Path=(hc:InfoElement.Placeholder),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ScrollViewer Margin="-2,0,-1,0" Grid.Column="0" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
|
||||
<Button Height="{x:Static system:Double.NaN}" Command="interactivity:ControlCommands.Clear" Margin="0,0,7,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="1" Style="{StaticResource ButtonIcon}" Padding="0,6" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{Binding BorderBrush,ElementName=templateRoot}"/>
|
||||
<Button Height="{x:Static system:Double.NaN}" Command="interactivity:ControlCommands.Clear" Margin="0,0,7,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="1" Style="{StaticResource ButtonIcon}" Padding="0" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{Binding BorderBrush,ElementName=templateRoot}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
@@ -210,7 +211,7 @@
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Column="1"/>
|
||||
<DockPanel LastChildFill="True" Grid.Column="0" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<DockPanel LastChildFill="True" Grid.Column="0" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{Binding Path=(hc:TitleElement.MarginOnTheLeft),RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}"/>
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
</DockPanel>
|
||||
@@ -222,7 +223,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="{TemplateBinding Text,Converter={StaticResource String2VisibilityReConverter}}" HorizontalAlignment="Stretch" Style="{StaticResource TextBlockDefaultThiLight}" Text="{Binding Path=(hc:InfoElement.Placeholder),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<ScrollViewer Grid.Column="0" Margin="-2,0,-1,0" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
|
||||
<Button Height="{x:Static system:Double.NaN}" Command="interactivity:ControlCommands.Clear" Margin="0,0,7,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="1" Style="{StaticResource ButtonIcon}" Padding="0,6" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{Binding BorderBrush,ElementName=templateRoot}"/>
|
||||
<Button Height="{x:Static system:Double.NaN}" Command="interactivity:ControlCommands.Clear" Margin="0,0,7,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="1" Style="{StaticResource ButtonIcon}" Padding="0" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{Binding BorderBrush,ElementName=templateRoot}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
||||
@@ -6,8 +6,27 @@
|
||||
|
||||
<Style BasedOn="{StaticResource TextBoxBaseStyle}" TargetType="TextBox"/>
|
||||
|
||||
<Style x:Key="TextBox.Small" BasedOn="{StaticResource TextBoxBaseStyle}" TargetType="TextBox">
|
||||
<Setter Property="MinHeight" Value="20"/>
|
||||
<Setter Property="Padding" Value="6,0"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TextBoxExtend" BasedOn="{StaticResource TextBoxExtendBaseStyle}" TargetType="TextBox"/>
|
||||
|
||||
<Style x:Key="TextBoxExtend.Small" BasedOn="{StaticResource TextBoxExtend}" TargetType="TextBox">
|
||||
<Setter Property="hc:InfoElement.MinContentHeight" Value="20"/>
|
||||
<Setter Property="hc:InfoElement.ContentHeight" Value="20"/>
|
||||
<Setter Property="hc:TitleElement.MarginOnTheLeft" Value="0,3,6,3"/>
|
||||
<Setter Property="Padding" Value="6,0"/>
|
||||
</Style>
|
||||
|
||||
<Style BasedOn="{StaticResource TextBoxPlusBaseStyle}" TargetType="hc:TextBox"/>
|
||||
|
||||
<Style x:Key="TextBoxPlus.Small" BasedOn="{StaticResource TextBoxPlusBaseStyle}" TargetType="hc:TextBox">
|
||||
<Setter Property="hc:InfoElement.MinContentHeight" Value="20"/>
|
||||
<Setter Property="hc:InfoElement.ContentHeight" Value="20"/>
|
||||
<Setter Property="hc:TitleElement.MarginOnTheLeft" Value="0,3,6,3"/>
|
||||
<Setter Property="Padding" Value="6,0"/>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -6333,6 +6333,7 @@
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
|
||||
<Setter Property="AllowDrop" Value="true" />
|
||||
<Setter Property="Padding" Value="{StaticResource DefaultInputPadding}" />
|
||||
<Setter Property="hc:TitleElement.MarginOnTheLeft" Value="0,8,6,8" />
|
||||
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
@@ -6392,7 +6393,7 @@
|
||||
<ColumnDefinition Width="{Binding Path=(hc:InfoElement.TitleWidth),RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<DockPanel LastChildFill="True" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{Binding Path=(hc:TitleElement.MarginOnTheLeft),RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}" />
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</DockPanel>
|
||||
@@ -6454,7 +6455,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="{TemplateBinding Text,Converter={StaticResource String2VisibilityReConverter}}" HorizontalAlignment="Stretch" Style="{StaticResource TextBlockDefaultThiLight}" Text="{Binding Path=(hc:InfoElement.Placeholder),RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<ScrollViewer Margin="-2,0,-1,0" Grid.Column="0" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" />
|
||||
<Button Height="{x:Static system:Double.NaN}" Command="interactivity:ControlCommands.Clear" Margin="0,0,7,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="1" Style="{StaticResource ButtonIcon}" Padding="0,6" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{Binding BorderBrush,ElementName=templateRoot}" />
|
||||
<Button Height="{x:Static system:Double.NaN}" Command="interactivity:ControlCommands.Clear" Margin="0,0,7,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="1" Style="{StaticResource ButtonIcon}" Padding="0" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{Binding BorderBrush,ElementName=templateRoot}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
@@ -6501,7 +6502,7 @@
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock FontSize="12" Text="{TemplateBinding ErrorStr}" Name="TextBlockError" VerticalAlignment="Bottom" Margin="9,0,0,4" Foreground="{DynamicResource DangerBrush}" Grid.Column="1" />
|
||||
<DockPanel LastChildFill="True" Grid.Column="0" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="0,7,6,7">
|
||||
<DockPanel LastChildFill="True" Grid.Column="0" Visibility="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource String2VisibilityConverter}}" HorizontalAlignment="{Binding Path=(hc:TitleElement.HorizontalAlignment),RelativeSource={RelativeSource TemplatedParent}}" VerticalAlignment="{Binding Path=(hc:TitleElement.VerticalAlignment),RelativeSource={RelativeSource TemplatedParent}}" Margin="{Binding Path=(hc:TitleElement.MarginOnTheLeft),RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ContentPresenter DockPanel.Dock="Right" TextElement.Foreground="{DynamicResource DangerBrush}" Margin="4,0,0,0" Content="{Binding Path=(hc:InfoElement.Symbol),RelativeSource={RelativeSource TemplatedParent}}" Visibility="{Binding Path=(hc:InfoElement.Necessary),RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}" />
|
||||
<TextBlock hc:TextBlockAttach.AutoTooltip="True" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Path=(hc:InfoElement.Title),RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</DockPanel>
|
||||
@@ -6513,7 +6514,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="{TemplateBinding Text,Converter={StaticResource String2VisibilityReConverter}}" HorizontalAlignment="Stretch" Style="{StaticResource TextBlockDefaultThiLight}" Text="{Binding Path=(hc:InfoElement.Placeholder),RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<ScrollViewer Grid.Column="0" Margin="-2,0,-1,0" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" />
|
||||
<Button Height="{x:Static system:Double.NaN}" Command="interactivity:ControlCommands.Clear" Margin="0,0,7,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="1" Style="{StaticResource ButtonIcon}" Padding="0,6" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{Binding BorderBrush,ElementName=templateRoot}" />
|
||||
<Button Height="{x:Static system:Double.NaN}" Command="interactivity:ControlCommands.Clear" Margin="0,0,7,0" Visibility="Collapsed" Name="ButtonClear" Width="16" Grid.Column="1" Style="{StaticResource ButtonIcon}" Padding="0" hc:IconElement.Geometry="{StaticResource DeleteFillCircleGeometry}" Foreground="{Binding BorderBrush,ElementName=templateRoot}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
@@ -6806,8 +6807,24 @@
|
||||
<Style BasedOn="{StaticResource ComboBoxPlusBaseStyle}" TargetType="hc:ComboBox" />
|
||||
<Style BasedOn="{StaticResource WatermarkTextBoxBaseStyle}" TargetType="hc:WatermarkTextBox" />
|
||||
<Style BasedOn="{StaticResource TextBoxBaseStyle}" TargetType="TextBox" />
|
||||
<Style x:Key="TextBox.Small" BasedOn="{StaticResource TextBoxBaseStyle}" TargetType="TextBox">
|
||||
<Setter Property="MinHeight" Value="20" />
|
||||
<Setter Property="Padding" Value="6,0" />
|
||||
</Style>
|
||||
<Style x:Key="TextBoxExtend" BasedOn="{StaticResource TextBoxExtendBaseStyle}" TargetType="TextBox" />
|
||||
<Style x:Key="TextBoxExtend.Small" BasedOn="{StaticResource TextBoxExtend}" TargetType="TextBox">
|
||||
<Setter Property="hc:InfoElement.MinContentHeight" Value="20" />
|
||||
<Setter Property="hc:InfoElement.ContentHeight" Value="20" />
|
||||
<Setter Property="hc:TitleElement.MarginOnTheLeft" Value="0,3,6,3" />
|
||||
<Setter Property="Padding" Value="6,0" />
|
||||
</Style>
|
||||
<Style BasedOn="{StaticResource TextBoxPlusBaseStyle}" TargetType="hc:TextBox" />
|
||||
<Style x:Key="TextBoxPlus.Small" BasedOn="{StaticResource TextBoxPlusBaseStyle}" TargetType="hc:TextBox">
|
||||
<Setter Property="hc:InfoElement.MinContentHeight" Value="20" />
|
||||
<Setter Property="hc:InfoElement.ContentHeight" Value="20" />
|
||||
<Setter Property="hc:TitleElement.MarginOnTheLeft" Value="0,3,6,3" />
|
||||
<Setter Property="Padding" Value="6,0" />
|
||||
</Style>
|
||||
<Style BasedOn="{StaticResource MenuItemBaseStyle}" TargetType="MenuItem" />
|
||||
<Style BasedOn="{StaticResource MenuBaseStyle}" TargetType="Menu" />
|
||||
<ControlTemplate x:Key="BadgeTextTemplate" TargetType="hc:Badge">
|
||||
|
||||
Reference in new issue
Block a user