-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<ResourceDictionary | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:ui="clr-namespace:Wpf.Ui.Controls;assembly=Wpf.Ui"> | ||
|
||
<Style x:Key="TransparentTextBoxStyle" TargetType="{x:Type TextBox}"> | ||
<Setter Property="Background" Value="Transparent" /> | ||
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" /> | ||
<Setter Property="BorderThickness" Value="0" /> | ||
<Setter Property="BorderBrush" Value="Transparent" /> | ||
</Style> | ||
|
||
<Style x:Key="TransparentUiTextBoxStyle" TargetType="{x:Type ui:TextBox}"> | ||
<Setter Property="Background" Value="Transparent" /> | ||
<Setter Property="Foreground" Value="{DynamicResource TextFillColorPrimaryBrush}" /> | ||
<Setter Property="BorderThickness" Value="0" /> | ||
<Setter Property="BorderBrush" Value="Transparent" /> | ||
<Setter Property="Template"> | ||
<Setter.Value> | ||
<ControlTemplate TargetType="{x:Type ui:TextBox}"> | ||
<Grid HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}"> | ||
<Border | ||
x:Name="ContentBorder" | ||
MinWidth="{TemplateBinding MinWidth}" | ||
MinHeight="{TemplateBinding MinHeight}" | ||
Padding="0" | ||
HorizontalAlignment="Stretch" | ||
VerticalAlignment="Stretch" | ||
Background="{TemplateBinding Background}" | ||
BorderBrush="{TemplateBinding BorderBrush}" | ||
BorderThickness="{TemplateBinding BorderThickness}" | ||
CornerRadius="{TemplateBinding Border.CornerRadius}"> | ||
<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"> | ||
<Grid.ColumnDefinitions> | ||
<ColumnDefinition Width="*" /> | ||
<ColumnDefinition Width="Auto" /> | ||
</Grid.ColumnDefinitions> | ||
|
||
<Grid Grid.Column="0" Margin="{TemplateBinding Padding}"> | ||
<ScrollViewer | ||
x:Name="PART_ContentHost" | ||
VerticalAlignment="Center" | ||
CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}" | ||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" | ||
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" | ||
IsTabStop="{TemplateBinding ScrollViewer.IsTabStop}" | ||
Style="{StaticResource DefaultTextBoxScrollViewerStyle}" | ||
TextElement.Foreground="{TemplateBinding Foreground}" | ||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" /> | ||
<TextBlock | ||
x:Name="PlaceholderTextBox" | ||
Margin="0" | ||
Padding="1,0" | ||
VerticalAlignment="Center" | ||
Text="{TemplateBinding PlaceholderText}" | ||
Visibility="Collapsed"> | ||
<TextBlock.Foreground> | ||
<SolidColorBrush Color="{DynamicResource TextPlaceholderColor}" /> | ||
</TextBlock.Foreground> | ||
</TextBlock> | ||
</Grid> | ||
</Grid> | ||
</Border> | ||
</Grid> | ||
<ControlTemplate.Triggers> | ||
<Trigger Property="Text" Value="{x:Null}"> | ||
<Setter TargetName="PlaceholderTextBox" Property="Visibility" Value="Visible" /> | ||
</Trigger> | ||
<Trigger Property="Text" Value=""> | ||
<Setter TargetName="PlaceholderTextBox" Property="Visibility" Value="Visible" /> | ||
</Trigger> | ||
<Trigger Property="PlaceholderEnabled" Value="False"> | ||
<Setter TargetName="PlaceholderTextBox" Property="Visibility" Value="Collapsed" /> | ||
</Trigger> | ||
<Trigger Property="IsEnabled" Value="True"> | ||
<Setter Property="Cursor" Value="IBeam" /> | ||
</Trigger> | ||
<Trigger Property="IsEnabled" Value="False"> | ||
<Setter TargetName="PlaceholderTextBox" Property="Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" /> | ||
<Setter Property="Foreground" Value="{DynamicResource TextFillColorDisabledBrush}" /> | ||
<Setter Property="ClearButtonEnabled" Value="False" /> | ||
</Trigger> | ||
</ControlTemplate.Triggers> | ||
</ControlTemplate> | ||
</Setter.Value> | ||
</Setter> | ||
</Style> | ||
|
||
</ResourceDictionary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters