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

53 lines
2.8 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.AbstractBooleanStyle"
xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
xmlns:abstractUI="clr-namespace:OwlCore.AbstractUI.ViewModels;assembly=OwlCore"
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="DefaultAbstractBooleanTemplate" DataType="abstractUI:AbstractBooleanViewModel">
2021-10-23 21:22:07 -05:00
<StackPanel Margin="0,0,0,4">
2021-10-23 21:51:51 -05:00
<TextBlock Text="{Binding Title, Mode=OneWay}"
2021-10-23 21:22:07 -05:00
FontSize="{StaticResource DefaultAbstractUITitleFontSize}"
2021-10-23 21:51:51 -05:00
ToolTipService.ToolTip="{Binding TooltipText, Mode=OneWay}"
Visibility="{Binding Title, TargetNullValue=Collapsed, Mode=OneWay}" />
2021-08-05 20:45:26 -05:00
2021-10-23 21:51:51 -05:00
<TextBlock Text="{Binding Subtitle, Mode=OneWay}"
2021-10-23 21:22:07 -05:00
FontSize="{StaticResource DefaultAbstractUISubtitleFontSize}"
2021-08-05 20:45:26 -05:00
FontWeight="{StaticResource DefaultAbstractUISubtitleFontWeight}"
Opacity="{StaticResource DefaultAbstractUISubtitleOpacity}"
2021-10-23 21:51:51 -05:00
Visibility="{Binding Subtitle, TargetNullValue=Collapsed}"/>
2021-08-05 20:45:26 -05:00
2021-10-23 21:51:51 -05:00
<CheckBox ToolTipService.ToolTip="{Binding TooltipText, Mode=OneWay}"
Content="{Binding Label, Mode=OneWay}"
IsChecked="{Binding IsToggled, Mode=TwoWay}">
2021-08-05 20:45:26 -05:00
<behaviors:Interaction.Triggers>
<behaviors:EventTrigger EventName="Checked">
2021-10-23 21:51:51 -05:00
<behaviors:InvokeCommandAction Command="{Binding ToggledCommand}" />
2021-08-05 20:45:26 -05:00
</behaviors:EventTrigger>
</behaviors:Interaction.Triggers>
</CheckBox>
</StackPanel>
</DataTemplate>
<Style TargetType="controls:AbstractBooleanPresenter">
<Style.Setters>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:AbstractBooleanPresenter">
<ContentControl ContentTemplate="{StaticResource DefaultAbstractBooleanTemplate}"
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>