|
|
@@ -1,4 +1,5 @@
|
|
|
-<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>
|
|
|
@@ -8,7 +9,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}" />
|
|
|
@@ -18,73 +19,34 @@
|
|
|
<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)}">
|
|
|
-
|
|
|
- <Panel>
|
|
|
- <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}"/>
|
|
|
- </Panel>
|
|
|
+ <ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}" VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
|
|
|
+ <Grid ColumnDefinition="Auto,*,Auto">
|
|
|
+ <ContentPresenter Grid.Column="0" Grid.ColumnSpan="1" Content="{Binding 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}"/>
|
|
|
+ <!-- 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}"/>
|
|
|
+ </Panel>
|
|
|
+ <ContentPresenter Grid.Column="2" Grid.ColumnSpan="1" Content="{Binding InnerRightContent}"/>
|
|
|
+ </Grid>
|
|
|
</ScrollViewer>
|
|
|
</DataValidationErrors>
|
|
|
</DockPanel>
|