|
|
|
@ -1,43 +1,43 @@ |
|
|
|
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|
|
|
<Style Selector="TextBox"> |
|
|
|
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}"/> |
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/> |
|
|
|
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}"/> |
|
|
|
<Setter Property="Padding" Value="4"/> |
|
|
|
<Setter Property="Template"> |
|
|
|
<ControlTemplate> |
|
|
|
<Border Name="border" |
|
|
|
<Style Selector="TextBox"> |
|
|
|
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}"/> |
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/> |
|
|
|
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}"/> |
|
|
|
<Setter Property="Padding" Value="4"/> |
|
|
|
<Setter Property="Template"> |
|
|
|
<ControlTemplate> |
|
|
|
<Border Name="border" |
|
|
|
Background="{TemplateBinding Background}" |
|
|
|
BorderBrush="{TemplateBinding BorderBrush}" |
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"> |
|
|
|
<DockPanel Margin="{TemplateBinding Padding}"> |
|
|
|
<DockPanel Margin="{TemplateBinding Padding}"> |
|
|
|
|
|
|
|
<TextBlock Name="floatingWatermark" |
|
|
|
<TextBlock Name="floatingWatermark" |
|
|
|
Foreground="{DynamicResource ThemeAccentBrush}" |
|
|
|
FontSize="{DynamicResource FontSizeSmall}" |
|
|
|
Text="{TemplateBinding Watermark}" |
|
|
|
DockPanel.Dock="Top"> |
|
|
|
<TextBlock.IsVisible> |
|
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}"> |
|
|
|
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
|
|
|
<TextBlock.IsVisible> |
|
|
|
<MultiBinding Converter="{x:Static BoolConverters.And}"> |
|
|
|
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
|
|
|
Path="UseFloatingWatermark"/> |
|
|
|
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
|
|
|
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
|
|
|
Path="Text" |
|
|
|
Converter="{x:Static StringConverters.NotNullOrEmpty}"/> |
|
|
|
</MultiBinding> |
|
|
|
</TextBlock.IsVisible> |
|
|
|
</TextBlock> |
|
|
|
</MultiBinding> |
|
|
|
</TextBlock.IsVisible> |
|
|
|
</TextBlock> |
|
|
|
|
|
|
|
<DataValidationErrors> |
|
|
|
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}" |
|
|
|
<DataValidationErrors> |
|
|
|
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}" |
|
|
|
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}"> |
|
|
|
|
|
|
|
<Panel> |
|
|
|
<TextBlock Name="watermark" |
|
|
|
<Panel> |
|
|
|
<TextBlock Name="watermark" |
|
|
|
Opacity="0.5" |
|
|
|
Text="{TemplateBinding Watermark}" |
|
|
|
IsVisible="{TemplateBinding Text, Converter={x:Static StringConverters.NullOrEmpty}}"/> |
|
|
|
<TextPresenter Name="PART_TextPresenter" |
|
|
|
<TextPresenter Name="PART_TextPresenter" |
|
|
|
Text="{TemplateBinding Text, Mode=TwoWay}" |
|
|
|
CaretIndex="{TemplateBinding CaretIndex}" |
|
|
|
SelectionStart="{TemplateBinding SelectionStart}" |
|
|
|
@ -45,24 +45,24 @@ |
|
|
|
TextAlignment="{TemplateBinding TextAlignment}" |
|
|
|
TextWrapping="{TemplateBinding TextWrapping}" |
|
|
|
PasswordChar="{TemplateBinding PasswordChar}"/> |
|
|
|
</Panel> |
|
|
|
</ScrollViewer> |
|
|
|
</DataValidationErrors> |
|
|
|
</DockPanel> |
|
|
|
</Border> |
|
|
|
</ControlTemplate> |
|
|
|
</Setter> |
|
|
|
</Style> |
|
|
|
<Style Selector="TextBox:pointerover /template/ Border#border"> |
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderHighBrush}"/> |
|
|
|
</Style> |
|
|
|
<Style Selector="TextBox:focus /template/ Border#border"> |
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderHighBrush}"/> |
|
|
|
</Style> |
|
|
|
<Style Selector="TextBox:error /template/ Border#border"> |
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ErrorBrush}"/> |
|
|
|
</Style> |
|
|
|
<Style Selector="TextBox"> |
|
|
|
<Setter Property="Cursor" Value="IBeam" /> |
|
|
|
</Style> |
|
|
|
</Panel> |
|
|
|
</ScrollViewer> |
|
|
|
</DataValidationErrors> |
|
|
|
</DockPanel> |
|
|
|
</Border> |
|
|
|
</ControlTemplate> |
|
|
|
</Setter> |
|
|
|
</Style> |
|
|
|
<Style Selector="TextBox:pointerover /template/ Border#border"> |
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderHighBrush}"/> |
|
|
|
</Style> |
|
|
|
<Style Selector="TextBox:focus /template/ Border#border"> |
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderHighBrush}"/> |
|
|
|
</Style> |
|
|
|
<Style Selector="TextBox:error /template/ Border#border"> |
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource ErrorBrush}"/> |
|
|
|
</Style> |
|
|
|
<Style Selector="TextBox"> |
|
|
|
<Setter Property="Cursor" Value="IBeam" /> |
|
|
|
</Style> |
|
|
|
</Styles> |
|
|
|
|