Files
ZuneModdingHelper/OwlCore.Wpf/AbstractUI/Themes/AbstractTextBoxStyle.xaml
T

50 lines
2.6 KiB
XML
Raw Normal View History

2021-08-05 20:45:26 -05:00
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="OwlCore.Wpf.AbstractUI.Themes.AbstractTextBoxStyle"
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
2024-03-12 17:06:06 -05:00
xmlns:abstractUI="clr-namespace:OwlCore.AbstractUI.ViewModels;assembly=OwlCore.AbstractUI"
2021-08-05 20:45:26 -05:00
xmlns:convertvis="clr-namespace:OwlCore.Wpf.Converters.Bools.Visible"
xmlns:controls="clr-namespace:OwlCore.Wpf.AbstractUI.Controls">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/OwlCore.Wpf;component/AbstractUI/Themes/AbstractUIResources.xaml" />
</ResourceDictionary.MergedDictionaries>
<DataTemplate x:Key="DefaultAbstractTextBoxTemplate" DataType="abstractUI:AbstractTextBoxViewModel">
<StackPanel>
2024-05-17 20:53:11 -05:00
<TextBlock Text="{Binding Title, Mode=OneWay}" ToolTipService.ToolTip="{Binding TooltipText, Mode=OneWay}"
2024-05-17 23:41:57 -05:00
Visibility="{Binding Title, Converter={StaticResource NotNullToVis}}"
2024-05-17 20:53:11 -05:00
Style="{DynamicResource AbstractUICollectionTitleStyle}" />
2021-08-05 20:45:26 -05:00
2024-05-17 20:53:11 -05:00
<TextBlock Text="{Binding Subtitle, Mode=OneWay}"
2024-05-17 23:41:57 -05:00
Visibility="{Binding Subtitle, Converter={StaticResource NotNullToVis}}"
2024-05-17 20:53:11 -05:00
Style="{DynamicResource AbstractUICollectionSubtitleStyle}" />
2021-08-05 20:45:26 -05:00
<TextBox Text="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Margin="0,5,0,0"
ToolTipService.ToolTip="{Binding TooltipText, Mode=OneWay}">
<behaviors:Interaction.Triggers>
<behaviors:EventTrigger EventName="TextChanging">
<behaviors:InvokeCommandAction Command="{Binding ValueChangedCommand}" />
</behaviors:EventTrigger>
</behaviors:Interaction.Triggers>
</TextBox>
</StackPanel>
</DataTemplate>
<Style TargetType="controls:AbstractTextBoxPresenter">
<Style.Setters>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:AbstractTextBoxPresenter">
<ContentControl ContentTemplate="{StaticResource DefaultAbstractTextBoxTemplate}"
2021-10-23 21:51:51 -05:00
Content="{Binding}"
2021-08-05 20:45:26 -05:00
HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style.Setters>
</Style>
</ResourceDictionary>