Files
Speckle.Material.Avalonia/Material.Styles/TextBox.xaml
T
2021-02-11 18:52:53 +09:00

559 lines
33 KiB
XML

<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:animations="clr-namespace:Material.Styles.Additional.Animations"
xmlns:wpf="clr-namespace:Material.Styles.Assists"
xmlns:styles="clr-namespace:Material.Styles"
xmlns:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia">
<Styles.Resources>
<StreamGeometry x:Key="TextBoxClearButtonData">M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z</StreamGeometry>
<StreamGeometry x:Key="PasswordBoxRevealButtonData">M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z</StreamGeometry>
<StreamGeometry x:Key="PasswordBoxHideButtonData">M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z</StreamGeometry>
<StreamGeometry x:Key="MaterialContentCut" >M19 3L13 9L15 11L22 4V3M12 12.5A0.5 0.5 0 0 1 11.5 12A0.5 0.5 0 0 1 12 11.5A0.5 0.5 0 0 1 12.5 12A0.5 0.5 0 0 1 12 12.5M6 20A2 2 0 0 1 4 18C4 16.89 4.9 16 6 16A2 2 0 0 1 8 18C8 19.11 7.1 20 6 20M6 8A2 2 0 0 1 4 6C4 4.89 4.9 4 6 4A2 2 0 0 1 8 6C8 7.11 7.1 8 6 8M9.64 7.64C9.87 7.14 10 6.59 10 6A4 4 0 0 0 6 2A4 4 0 0 0 2 6A4 4 0 0 0 6 10C6.59 10 7.14 9.87 7.64 9.64L10 12L7.64 14.36C7.14 14.13 6.59 14 6 14A4 4 0 0 0 2 18A4 4 0 0 0 6 22A4 4 0 0 0 10 18C10 17.41 9.87 16.86 9.64 16.36L12 14L19 21H22V20L9.64 7.64Z</StreamGeometry>
<StreamGeometry x:Key="MaterialContentCopy" >M19 21H8V7H19M19 5H8A2 2 0 0 0 6 7V21A2 2 0 0 0 8 23H19A2 2 0 0 0 21 21V7A2 2 0 0 0 19 5M16 1H4A2 2 0 0 0 2 3V17H4V3H16V1Z</StreamGeometry>
<StreamGeometry x:Key="MaterialContentPaste" >M19 20H5V4H7V7H17V4H19M12 2A1 1 0 0 1 13 3A1 1 0 0 1 12 4A1 1 0 0 1 11 3A1 1 0 0 1 12 2M19 2H14.82C14.4 0.84 13.3 0 12 0C10.7 0 9.6 0.84 9.18 2H5A2 2 0 0 0 3 4V20A2 2 0 0 0 5 22H19A2 2 0 0 0 21 20V4A2 2 0 0 0 19 2Z</StreamGeometry>
<StreamGeometry x:Key="MaterialSelectAll">M9 9H15V15H9M7 17H17V7H7M15 5H17V3H15M15 21H17V19H15M19 17H21V15H19M19 9H21V7H19M19 21A2 2 0 0 0 21 19H19M19 13H21V11H19M11 21H13V19H11M9 3H7V5H9M3 17H5V15H3M5 21V19H3A2 2 0 0 0 5 21M19 3V5H21A2 2 0 0 0 19 3M13 3H11V5H13M3 9H5V7H3M7 21H9V19H7M3 13H5V11H3M3 5H5V3A2 2 0 0 0 3 5Z</StreamGeometry>
<ContextMenu x:Key="DefaultTextBoxContextMenu" x:Name="TextBoxContextMenu" WindowManagerAddShadowHint="False">
<MenuItem x:Name="TextBoxContextMenuCutItem" Header="Cut" Command="{Binding $parent[TextBox].Cut}"
IsEnabled="{Binding $parent[TextBox].CanCut}" InputGesture="{x:Static TextBox.CutGesture}" >
<MenuItem.Icon>
<Path Data="{StaticResource MaterialContentCut}" Fill="{DynamicResource MaterialDesignBody}"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem x:Name="TextBoxContextMenuCopyItem" Header="Copy" Command="{Binding $parent[TextBox].Copy}"
IsEnabled="{Binding $parent[TextBox].CanCopy}" InputGesture="{x:Static TextBox.CopyGesture}" >
<MenuItem.Icon>
<Path Data="{StaticResource MaterialContentCopy}" Fill="{DynamicResource MaterialDesignBody}"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem x:Name="TextBoxContextMenuPasteItem" Header="Paste" Command="{Binding $parent[TextBox].Paste}"
IsEnabled="{Binding $parent[TextBox].CanPaste}" InputGesture="{x:Static TextBox.PasteGesture}" >
<MenuItem.Icon>
<Path Data="{StaticResource MaterialContentPaste}" Fill="{DynamicResource MaterialDesignBody}"/>
</MenuItem.Icon>
</MenuItem>
<Separator/>
<MenuItem x:Name="TextBoxContextMenuSelectAllItem" Header="Select All" Command="{Binding $parent[TextBox].SelectAll}">
<MenuItem.Icon>
<Path Data="{StaticResource MaterialSelectAll}" Fill="{DynamicResource MaterialDesignBody}"/>
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
</Styles.Resources>
<!-- Resting TextBox -->
<Style Selector="TextBox">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="SelectionBrush" Value="{DynamicResource MaterialDesignSelection}" />
<Setter Property="SelectionForegroundBrush" Value="{DynamicResource PrimaryHueMidForegroundBrush}" />
<Setter Property="Margin" Value="0,8" />
<Setter Property="ContextMenu" Value="{StaticResource DefaultTextBoxContextMenu}" />
<Setter Property="CaretBrush" Value="{Binding RelativeSource={RelativeSource Self}, Path=Foreground}"/>
<Setter Property="FontFamily" Value="avares://Material.Styles/Fonts/Roboto#Roboto"/>
<Setter Property="Template">
<ControlTemplate>
<StackPanel>
<Border Name="PART_RootBorder" Cursor="Ibeam"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<DataValidationErrors Name="DataValidation" >
<Grid ColumnDefinitions="Auto,*,Auto">
<ContentPresenter Grid.Column="0"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Content="{TemplateBinding InnerLeftContent}" />
<ScrollViewer Grid.Column="1"
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
<Panel Margin="1,0,1,0"
VerticalAlignment="Bottom">
<TextBlock Name="watermark"
Margin="0,6,0,7"
Classes="Subtitle1"
Opacity="0.5"
Text="{TemplateBinding Watermark}"
FontFamily="{TemplateBinding FontFamily}"
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}">
</TextBlock>
<TextPresenter Name="PART_TextPresenter"
Margin="0,6,0,7"
FontSize="16"
Text="{TemplateBinding Text, Mode=TwoWay}"
CaretIndex="{TemplateBinding CaretIndex}"
SelectionStart="{TemplateBinding SelectionStart}"
SelectionEnd="{TemplateBinding SelectionEnd}"
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}"
PasswordChar="{TemplateBinding PasswordChar}"
RevealPassword="{TemplateBinding RevealPassword}"
SelectionBrush="{TemplateBinding SelectionBrush}"
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
CaretBrush="{TemplateBinding CaretBrush}" />
</Panel>
</ScrollViewer>
<ContentPresenter Grid.Column="2"
MinHeight="32"
VerticalAlignment="Top"
Content="{TemplateBinding InnerRightContent}" />
</Grid>
</DataValidationErrors>
<styles:MaterialUnderline Classes="MirrorY"
VerticalAlignment="Bottom"
Name="Underline"/>
</Grid>
</Border>
<TextBlock Name="HintsTextBlock" Classes="Caption" Margin="0,3,0,0"
Text="{TemplateBinding (wpf:TextFieldAssist.Hints)}"/>
</StackPanel>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="TextBox /template/ TextBlock#HintsTextBlock">
<Setter Property="IsVisible" Value="{Binding !!Text, RelativeSource={RelativeSource Self}}"/>
</Style>
<Style Selector="TextBox:disabled /template/ Border#PART_RootBorder">
<Setter Property="Opacity" Value="0.5" />
</Style>
<Style Selector="TextBox:focus-within:empty /template/ TextBlock#watermark,
TextBox:empty /template/ TextBlock#watermark">
<Setter Property="IsVisible" Value="True"/>
</Style>
<Style Selector="TextBox:focus-within:not(:empty) /template/ TextBlock#watermark,
TextBox:not(:empty) /template/ TextBlock#watermark">
<Setter Property="IsVisible" Value="False"/>
</Style>
<Style Selector="TextBox /template/ Border#PART_RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextBoxBorder}" />
</Style>
<Style Selector="TextBox:focus-within /template/ styles|MaterialUnderline#Underline">
<Setter Property="IsExpanded" Value="True"></Setter>
</Style>
<Style Selector="TextBox:pointerover /template/ styles|MaterialUnderline#Underline">
<Setter Property="IsActive" Value="True"></Setter>
</Style>
<Style Selector="TextBox:disabled /template/ Border#PART_RootBorder">
<Setter Property="Opacity" Value="{DynamicResource ThemeDisabledOpacity}" />
</Style>
<!-- Floating TextBox style -->
<Style Selector="TextBox.Floating">
<Setter Property="Background" Value="Transparent" />
<Setter Property="SelectionBrush" Value="{DynamicResource MaterialDesignSelection}" />
<Setter Property="SelectionForegroundBrush" Value="{DynamicResource PrimaryHueMidForegroundBrush}" />
<Setter Property="Margin" Value="0,8" />
<Setter Property="ContextMenu" Value="{StaticResource DefaultTextBoxContextMenu}" />
<Setter Property="CaretBrush" Value="{Binding RelativeSource={RelativeSource Self}, Path=Foreground}"/>
<Setter Property="Template">
<ControlTemplate>
<StackPanel>
<Border Name="PART_RootBorder" Cursor="Ibeam" MinHeight="48"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<TextBlock Name="floatingWatermark"
VerticalAlignment="Top"
HorizontalAlignment="Stretch"
Classes="Subtitle1"
Foreground="{DynamicResource ThemeAccentBrush}"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{DynamicResource FontSizeSmall}"
Text="{TemplateBinding (wpf:TextFieldAssist.Label)}"
RenderTransformOrigin="0, 0"/>
<DataValidationErrors Name="DataValidation" >
<Grid ColumnDefinitions="Auto,*,Auto">
<ContentPresenter Grid.Column="0"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Content="{TemplateBinding InnerLeftContent}" />
<ScrollViewer Grid.Column="1"
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
<Panel Margin="1,16,1,0"
VerticalAlignment="Bottom">
<TextBlock Name="watermark"
Margin="0,6,0,7"
Classes="Subtitle1"
Opacity="0.5"
Text="{TemplateBinding Watermark}"
FontFamily="{TemplateBinding FontFamily}"
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}">
</TextBlock>
<TextPresenter Name="PART_TextPresenter"
Margin="0,6,0,7"
FontSize="16"
Text="{TemplateBinding Text, Mode=TwoWay}"
CaretIndex="{TemplateBinding CaretIndex}"
SelectionStart="{TemplateBinding SelectionStart}"
SelectionEnd="{TemplateBinding SelectionEnd}"
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}"
PasswordChar="{TemplateBinding PasswordChar}"
RevealPassword="{TemplateBinding RevealPassword}"
SelectionBrush="{TemplateBinding SelectionBrush}"
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
CaretBrush="{TemplateBinding CaretBrush}" />
</Panel>
</ScrollViewer>
<ContentPresenter Grid.Column="2"
MinHeight="32"
VerticalAlignment="Top"
Content="{TemplateBinding InnerRightContent}" />
</Grid>
</DataValidationErrors>
<styles:MaterialUnderline Classes="MirrorY"
VerticalAlignment="Bottom"
Name="Underline"/>
</Grid>
</Border>
<TextBlock Name="HintsTextBlock" Classes="Caption" Margin="0,3,0,0"
Text="{TemplateBinding (wpf:TextFieldAssist.Hints)}"
IsVisible="{Binding !!Text, RelativeSource={RelativeSource Self}}"/>
</StackPanel>
</ControlTemplate>
</Setter>
</Style>
<!-- Transitions for all styles textfield -->
<Style Selector="TextBox:not(.notransitions) /template/ TextBlock#floatingWatermark,
TextBox:not(.notransitions) /template/ Border#watermarkRoot">
<Setter Property="Transitions">
<Transitions>
<ThicknessTransition Duration="0:0:0.25" Property="Margin" Easing="CubicEaseOut"/>
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:0.25" Easing="CubicEaseOut"/>
</Transitions>
</Setter>
</Style>
<Style Selector="TextBox.Floating:focus-within:not(:empty) /template/ TextBlock#floatingWatermark,
TextBox.Floating:focus-within /template/ TextBlock#floatingWatermark,
TextBox.Floating:not(:empty) /template/ TextBlock#floatingWatermark">
<Setter Property="Margin" Value="1,0.75,1,1"/>
<Setter Property="RenderTransform" Value="scale(0.75)"/>
</Style>
<Style Selector="TextBox.Floating:empty:not(:focus) /template/ TextBlock#floatingWatermark">
<Setter Property="Margin" Value="1,24,1,1"/>
<Setter Property="RenderTransform" Value="scale(1)"/>
</Style>
<!-- Filled textfield -->
<Style Selector="TextBox.Filled">
<Setter Property="Background" Value="{DynamicResource MaterialDesignTextFieldBoxBackground}" />
<Setter Property="SelectionBrush" Value="{DynamicResource PrimaryHueMidBrush}" />
<Setter Property="SelectionForegroundBrush" Value="{DynamicResource PrimaryHueMidForegroundBrush}" />
<Setter Property="Padding" Value="0,8" />
<Setter Property="ContextMenu" Value="{StaticResource DefaultTextBoxContextMenu}" />
<Setter Property="CaretBrush" Value="{Binding RelativeSource={RelativeSource Self}, Path=Foreground}"/>
<Setter Property="Template">
<ControlTemplate>
<StackPanel>
<Border Name="PART_RootBorder" Cursor="Ibeam"
ClipToBounds="True" CornerRadius="4,4,0,0"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Border Name="focusBorder"
Background="{TemplateBinding Background}" />
<TextBlock Name="floatingWatermark" VerticalAlignment="Top"
HorizontalAlignment="Stretch" Classes="Subtitle1"
Foreground="{DynamicResource ThemeAccentBrush}"
FontSize="{DynamicResource FontSizeSmall}"
Text="{TemplateBinding (wpf:TextFieldAssist.Label)}"
RenderTransformOrigin="0, 0"/>
<DataValidationErrors Name="DataValidation">
<Grid ColumnDefinitions="Auto,*,Auto">
<ContentPresenter Grid.Column="0"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Content="{TemplateBinding InnerLeftContent}" />
<ScrollViewer Name="PART_Scroller" Grid.Column="1" Classes="Modern" Padding="16,0"
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
<TextPresenter Name="PART_TextPresenter"
FontSize="16"
FontWeight="Regular"
Text="{TemplateBinding Text, Mode=TwoWay}"
CaretIndex="{TemplateBinding CaretIndex}"
SelectionStart="{TemplateBinding SelectionStart}"
SelectionEnd="{TemplateBinding SelectionEnd}"
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}"
PasswordChar="{TemplateBinding PasswordChar}"
RevealPassword="{TemplateBinding RevealPassword}"
SelectionBrush="{TemplateBinding SelectionBrush}"
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
CaretBrush="{TemplateBinding CaretBrush}" />
</ScrollViewer>
<ContentPresenter Grid.Column="2"
MinHeight="32"
Margin="0,0,0,0"
VerticalAlignment="Top"
Content="{TemplateBinding InnerRightContent}" />
</Grid>
</DataValidationErrors>
<styles:MaterialUnderline Classes="MirrorY"
VerticalAlignment="Bottom"
Name="Underline"/>
</Grid>
</Border>
<TextBlock Name="HintsTextBlock" Classes="Caption" Margin="0,3,0,0"
Text="{TemplateBinding (wpf:TextFieldAssist.Hints)}"/>
</StackPanel>
</ControlTemplate>
</Setter>
</Style>
<!-- Feedbacks -->
<Style Selector="TextBox.Filled:focus-within:not(:empty) /template/ TextBlock#floatingWatermark,
TextBox.Filled:focus-within /template/ TextBlock#floatingWatermark,
TextBox.Filled:not(:empty) /template/ TextBlock#floatingWatermark">
<Setter Property="Margin" Value="16,8,1,1"/>
<Setter Property="RenderTransform" Value="scale(0.75)"/>
</Style>
<Style Selector="TextBox.Filled:empty:not(:focus-within) /template/ TextBlock#floatingWatermark">
<Setter Property="Margin" Value="16,18,1,1"/>
</Style>
<Style Selector="TextBox.Filled:focus-within /template/ Border#focusBorder">
<Setter Property="Opacity" Value="0.35"/>
</Style>
<!-- Default filled text field -->
<Style Selector="TextBox.Filled /template/ Border#PART_RootBorder">
<Setter Property="MinHeight" Value="56"/>
</Style>
<Style Selector="TextBox.Filled /template/ TextPresenter#PART_TextPresenter">
<Setter Property="Margin" Value="0,24,0,6"/>
</Style>
<Style Selector="TextBox.Filled:disabled /template/ Border#PART_RootBorder">
<Setter Property="Opacity" Value="0.34" />
</Style>
<!-- Filled dense text field -->
<Style Selector="TextBox.Filled.Dense /template/ Border#PART_RootBorder">
<Setter Property="MinHeight" Value="48"/>
</Style>
<Style Selector="TextBox.Filled.Dense /template/ TextPresenter#PART_TextPresenter">
<Setter Property="Margin" Value="0,22,0,0"/>
</Style>
<Style Selector="TextBox.Filled.Dense:empty:not(:focus-within) /template/ TextBlock#floatingWatermark">
<Setter Property="Margin" Value="16,14,1,1"/>
</Style>
<!-- Outline textfield -->
<Style Selector="TextBox.Outline">
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextBoxBorder}" />
<Setter Property="SelectionBrush" Value="{DynamicResource MaterialDesignSelection}" />
<Setter Property="SelectionForegroundBrush" Value="{DynamicResource PrimaryHueMidForegroundBrush}" />
<Setter Property="Padding" Value="0,8" />
<Setter Property="ClipToBounds" Value="False" />
<Setter Property="ContextMenu" Value="{StaticResource DefaultTextBoxContextMenu}" />
<Setter Property="CaretBrush" Value="{Binding RelativeSource={RelativeSource Self}, Path=Foreground}"/>
<Setter Property="Template">
<ControlTemplate>
<StackPanel>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
Cursor="Ibeam"
MinHeight="52"
Background="Transparent"
Margin="0,8,0,0"
ClipToBounds="False">
<Border Name="PART_RootBorder"
CornerRadius="4"
BorderBrush="{TemplateBinding BorderBrush}" >
<Border.Styles>
<Style Selector="Border:disabled, TextBlock:disabled">
<Setter Property="Opacity" Value="0.5" />
</Style>
</Border.Styles>
</Border>
<Border Name="watermarkRoot"
Background="{DynamicResource MaterialDesignPaper}"
HorizontalAlignment="Left"
VerticalAlignment="Top"
RenderTransformOrigin="0, 0" Opacity="1"
IsVisible="{TemplateBinding UseFloatingWatermark}">
<TextBlock Name="floatingWatermark"
Classes="Subtitle1"
HorizontalAlignment="Stretch"
Margin="4,2"
Foreground="{Binding ElementName=PART_RootBorder, Path=BorderBrush}"
Text="{TemplateBinding (wpf:TextFieldAssist.Label)}" />
</Border>
<DataValidationErrors Name="DataValidation" >
<Grid ColumnDefinitions="Auto,*,Auto">
<ContentPresenter Grid.Column="0"
VerticalAlignment="Top"
HorizontalAlignment="Left"
Content="{TemplateBinding InnerLeftContent}" />
<ScrollViewer Grid.Column="1"
Margin="16,16,8,16"
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}">
<TextPresenter Name="PART_TextPresenter"
FontSize="16"
FontWeight="Regular"
ClipToBounds="True"
Text="{TemplateBinding Text, Mode=TwoWay}"
CaretIndex="{TemplateBinding CaretIndex}"
SelectionStart="{TemplateBinding SelectionStart}"
SelectionEnd="{TemplateBinding SelectionEnd}"
TextAlignment="{TemplateBinding TextAlignment}"
TextWrapping="{TemplateBinding TextWrapping}"
PasswordChar="{TemplateBinding PasswordChar}"
RevealPassword="{TemplateBinding RevealPassword}"
SelectionBrush="{TemplateBinding SelectionBrush}"
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}"
CaretBrush="{TemplateBinding CaretBrush}" />
</ScrollViewer>
<ContentPresenter Grid.Column="2"
Margin="0,0,0,0"
MinHeight="32"
VerticalAlignment="Top"
Content="{TemplateBinding InnerRightContent}" />
</Grid>
</DataValidationErrors>
</Grid>
</StackPanel>
</ControlTemplate>
</Setter>
</Style>
<Style Selector="TextBox.Outline:focus-within:not(:empty) /template/ Border#watermarkRoot,
TextBox.Outline:focus-within /template/ Border#watermarkRoot,
TextBox.Outline:not(:empty) /template/ Border#watermarkRoot">
<Setter Property="Margin" Value="14,-9,1,1"/>
<Setter Property="RenderTransform" Value="scale(0.75)"/>
</Style>
<Style Selector="TextBox.Outline /template/ Border#PART_RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextBoxBorder}" />
<Setter Property="BorderThickness" Value="1"/>
</Style>
<Style Selector="TextBox.Outline:focus-within /template/ Border#PART_RootBorder">
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}" />
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="TextBox.Outline:empty:not(:focus-within) /template/ Border#watermarkRoot">
<Setter Property="Margin" Value="10,14,1,1"/>
</Style>
<!-- Additional decorations for TextFields -->
<!-- ReSharper disable InconsistentNaming -->
<Style Selector="TextBox.clearButton[AcceptsReturn=False][IsReadOnly=False]:not(TextBox:empty),
TextBox.revealPasswordButton[AcceptsReturn=False][IsReadOnly=False]:not(TextBox:empty)">
<Setter Property="InnerRightContent">
<Template>
<Border Name="PART_AssistButtonsContainer" Height="48" VerticalAlignment="Top"/>
</Template>
</Setter>
</Style>
<Style Selector="TextBox.clearButton[AcceptsReturn=False][IsReadOnly=False]:not(TextBox:empty) Border#PART_AssistButtonsContainer">
<Setter Property="Child">
<Template>
<Button Name="PART_ClearButton"
Classes="Icon" Command="{Binding $parent[TextBox].Clear}" Padding="4"
Cursor="Arrow" Focusable="True" Width="{Binding Path=$self.Height}">
<avalonia:MaterialIcon Kind="Close" Width="NaN" Height="NaN"/>
</Button>
</Template>
</Setter>
</Style>
<Style Selector="TextBox.revealPasswordButton[AcceptsReturn=False][IsReadOnly=False]:not(TextBox:empty) Border#PART_AssistButtonsContainer">
<Setter Property="Child">
<Template>
<ToggleButton Name="PART_PasswordRevealToggle" Classes="Icon ConstantForeground"
Width="{Binding Path=$self.Height}" Cursor="Arrow" Focusable="True" Padding="4"
IsChecked="{Binding $parent[TextBox].RevealPassword, Mode=OneWayToSource}" >
<ToggleButton.Styles>
<Style Selector="ToggleButton#PART_PasswordRevealToggle avalonia|MaterialIcon#PART_PackIconContent">
<Setter Property="Kind" Value="EyeOutline" />
</Style>
<Style Selector="ToggleButton#PART_PasswordRevealToggle:checked avalonia|MaterialIcon#PART_PackIconContent">
<Setter Property="Kind" Value="EyeOffOutline" />
</Style>
<Style Selector="ToggleButton#PART_PasswordRevealToggle[IsChecked=True]">
<Setter Property="(ToolTip.Tip)" Value="Hide Password" />
</Style>
<Style Selector="ToggleButton#PART_PasswordRevealToggle[IsChecked=False]">
<Setter Property="(ToolTip.Tip)" Value="Show Password" />
</Style>
</ToggleButton.Styles>
<avalonia:MaterialIcon Name="PART_PackIconContent" Width="NaN" Height="NaN"/>
</ToggleButton>
</Template>
</Setter>
</Style>
<Style Selector="TextBox.clearButton Button#PART_ClearButton">
<Setter Property="Height" Value="24"/>
</Style>
<Style Selector="TextBox.revealPasswordButton ToggleButton#PART_PasswordRevealToggle">
<Setter Property="Height" Value="24"/>
</Style>
<Style Selector="TextBox.Floating.clearButton Button#PART_ClearButton">
<Setter Property="Margin" Value="4, 14, 0, 4"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style Selector="TextBox.Floating.revealPasswordButton ToggleButton#PART_PasswordRevealToggle">
<Setter Property="Margin" Value="4, 14, 0, 4"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style Selector="TextBox.Filled.clearButton Button#PART_ClearButton, TextBox.Filled.revealPasswordButton ToggleButton#PART_PasswordRevealToggle,
TextBox.Outline.clearButton Button#PART_ClearButton, TextBox.Outline.revealPasswordButton ToggleButton#PART_PasswordRevealToggle">
<Setter Property="Margin" Value="0, 10, 8, 0"/>
<Setter Property="Height" Value="32"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<!-- ReSharper restore InconsistentNaming -->
<Design.PreviewWith>
<Border Padding="20">
<StackPanel>
<TextBox Classes="" Margin="8" Width="200" UseFloatingWatermark="True" wpf:TextFieldAssist.Label="TextBox"/>
<TextBox Classes="Filled" Width="200" UseFloatingWatermark="True" Watermark="TextBox"/>
<TextBox Classes="Filled" IsEnabled="False" Width="200" UseFloatingWatermark="True" Watermark="TextBox"/>
<TextBox Classes="Outline" IsEnabled="True" Width="200" UseFloatingWatermark="True" Watermark="TextBox3248239"/>
</StackPanel>
</Border>
</Design.PreviewWith>
</Styles>