|
|
@@ -1,5 +1,4 @@
|
|
|
-<Styles xmlns="https://github.com/avaloniaui"
|
|
|
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
+<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
<Styles.Resources>
|
|
|
<Thickness x:Key="TextBoxTopHeaderMargin">0,0,0,4</Thickness>
|
|
|
</Styles.Resources>
|
|
|
@@ -9,7 +8,7 @@
|
|
|
<Setter Property="CaretBrush" Value="{DynamicResource TextControlForeground}" />
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" />
|
|
|
<Setter Property="SelectionBrush" Value="{DynamicResource TextControlSelectionHighlightColor}" />
|
|
|
- <Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" />
|
|
|
+ <Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" />
|
|
|
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
|
|
|
<Setter Property="MinHeight" Value="{DynamicResource TextControlThemeMinHeight}" />
|
|
|
<Setter Property="MinWidth" Value="{DynamicResource TextControlThemeMinWidth}" />
|
|
|
@@ -19,33 +18,75 @@
|
|
|
<DockPanel>
|
|
|
|
|
|
<!-- TODO bind Content -> Header and ContentTemplate -> HeaderTemplate -->
|
|
|
- <ContentPresenter x:Name="HeaderContentPresenter" DockPanel.Dock="Top" TextBlock.FontWeight="Normal" TextBlock.Foreground="{DynamicResource TextControlHeaderForeground}" IsVisible="False" Margin="{DynamicResource TextBoxTopHeaderMargin}" />
|
|
|
+ <ContentPresenter x:Name="HeaderContentPresenter"
|
|
|
+ DockPanel.Dock="Top"
|
|
|
+ TextBlock.FontWeight="Normal"
|
|
|
+ TextBlock.Foreground="{DynamicResource TextControlHeaderForeground}"
|
|
|
+ IsVisible="False"
|
|
|
+ Margin="{DynamicResource TextBoxTopHeaderMargin}" />
|
|
|
|
|
|
<Panel>
|
|
|
- <Border Name="border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{DynamicResource ControlCornerRadius}" MinWidth="{TemplateBinding MinWidth}" MinHeight="{TemplateBinding MinHeight}">
|
|
|
+ <Border
|
|
|
+ Name="border"
|
|
|
+ Background="{TemplateBinding Background}"
|
|
|
+ BorderBrush="{TemplateBinding BorderBrush}"
|
|
|
+ BorderThickness="{TemplateBinding BorderThickness}"
|
|
|
+ CornerRadius="{DynamicResource ControlCornerRadius}"
|
|
|
+ MinWidth="{TemplateBinding MinWidth}"
|
|
|
+ MinHeight="{TemplateBinding MinHeight}">
|
|
|
</Border>
|
|
|
|
|
|
- <Border Padding="{TemplateBinding Padding}" Margin="{TemplateBinding BorderThickness}">
|
|
|
+ <Border
|
|
|
+ Padding="{TemplateBinding Padding}"
|
|
|
+ Margin="{TemplateBinding BorderThickness}">
|
|
|
<DockPanel>
|
|
|
- <TextBlock Name="floatingWatermark" Foreground="{DynamicResource SystemAccentColor}" FontSize="{DynamicResource FontSizeSmall}" Text="{TemplateBinding Watermark}" DockPanel.Dock="Top">
|
|
|
+ <TextBlock Name="floatingWatermark"
|
|
|
+ Foreground="{DynamicResource SystemAccentColor}"
|
|
|
+ FontSize="{DynamicResource FontSizeSmall}"
|
|
|
+ Text="{TemplateBinding Watermark}"
|
|
|
+ DockPanel.Dock="Top">
|
|
|
<TextBlock.IsVisible>
|
|
|
- <MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
|
- <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="UseFloatingWatermark"/>
|
|
|
- <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Text" Converter="{x:Static StringConverters.IsNotNullOrEmpty}"/>
|
|
|
- </MultiBinding>
|
|
|
+ <MultiBinding Converter="{x:Static BoolConverters.And}">
|
|
|
+ <Binding RelativeSource="{RelativeSource TemplatedParent}"
|
|
|
+ Path="UseFloatingWatermark"/>
|
|
|
+ <Binding RelativeSource="{RelativeSource TemplatedParent}"
|
|
|
+ Path="Text"
|
|
|
+ Converter="{x:Static StringConverters.IsNotNullOrEmpty}"/>
|
|
|
+ </MultiBinding>
|
|
|
</TextBlock.IsVisible>
|
|
|
</TextBlock>
|
|
|
|
|
|
<DataValidationErrors>
|
|
|
- <ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}" VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
|
|
|
+ <ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
|
|
|
+ VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
|
|
|
<Grid ColumnDefinitions="Auto,*,Auto">
|
|
|
- <TemplatedControl Grid.Column="0" Grid.ColumnSpan="1" Template="{TemplateBinding InnerLeftContent}"/>
|
|
|
+ <ContentPresenter Grid.Column="0" Grid.ColumnSpan="1" Content="{TemplateBinding InnerLeftContent}"/>
|
|
|
<Panel Grid.Column="1" Grid.ColumnSpan="1">
|
|
|
- <TextBlock Name="watermark" Opacity="0.5" Text="{TemplateBinding Watermark}" TextAlignment="{TemplateBinding TextAlignment}" TextWrapping="{TemplateBinding TextWrapping}" IsVisible="{TemplateBinding Text, Converter={x:Static StringConverters.IsNullOrEmpty}}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
|
+ <TextBlock Name="watermark"
|
|
|
+ Opacity="0.5"
|
|
|
+ Text="{TemplateBinding Watermark}"
|
|
|
+ TextAlignment="{TemplateBinding TextAlignment}"
|
|
|
+ TextWrapping="{TemplateBinding TextWrapping}"
|
|
|
+ IsVisible="{TemplateBinding Text, Converter={x:Static StringConverters.IsNullOrEmpty}}"
|
|
|
+ HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
+ VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
|
<!-- TODO eliminate this margin... text layout issue? -->
|
|
|
- <TextPresenter Name="PART_TextPresenter" Margin="0 1 0 0" Text="{TemplateBinding Text, Mode=TwoWay}" CaretIndex="{TemplateBinding CaretIndex}" SelectionStart="{TemplateBinding SelectionStart}" SelectionEnd="{TemplateBinding SelectionEnd}" TextAlignment="{TemplateBinding TextAlignment}" TextWrapping="{TemplateBinding TextWrapping}" PasswordChar="{TemplateBinding PasswordChar}" SelectionBrush="{TemplateBinding SelectionBrush}" SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}" CaretBrush="{TemplateBinding CaretBrush}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
|
+ <TextPresenter Name="PART_TextPresenter"
|
|
|
+ Margin="0 1 0 0"
|
|
|
+ Text="{TemplateBinding Text, Mode=TwoWay}"
|
|
|
+ CaretIndex="{TemplateBinding CaretIndex}"
|
|
|
+ SelectionStart="{TemplateBinding SelectionStart}"
|
|
|
+ SelectionEnd="{TemplateBinding SelectionEnd}"
|
|
|
+ TextAlignment="{TemplateBinding TextAlignment}"
|
|
|
+ TextWrapping="{TemplateBinding TextWrapping}"
|
|
|
+ PasswordChar="{TemplateBinding PasswordChar}"
|
|
|
+ SelectionBrush="{TemplateBinding SelectionBrush}"
|
|
|
+ SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
|
|
|
+ CaretBrush="{TemplateBinding CaretBrush}"
|
|
|
+ HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
|
+ VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
|
|
</Panel>
|
|
|
- <TemplatedControl Grid.Column="2" Grid.ColumnSpan="1" Template="{TemplateBinding InnerRightContent}"/>
|
|
|
+ <ContentPresenter Grid.Column="0" Grid.ColumnSpan="1" Content="{TemplateBinding InnerLeftContent}"/>
|
|
|
</Grid>
|
|
|
</ScrollViewer>
|
|
|
</DataValidationErrors>
|