<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:butterflow_ui">
    <Style x:Key="butterFlowOptionStyle" TargetType="{x:Type local:ButterflowOption}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:ButterflowOption}">
                    <Grid Height="Auto">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Label Grid.Column="0" Name="Label" VerticalAlignment="Center" Content="{TemplateBinding LabelValue}" />
                        <ContentControl Grid.Column="1" Name="ContentArea" VerticalAlignment="Center" Content="{TemplateBinding Content}" />
                        <ContentControl Template="{DynamicResource InfoIcon}" Grid.Column="2" Name="InfoBox" Margin="2,0,2,0" Width="16">
                            <ContentControl.ToolTip>
                                <ToolTip Style="{DynamicResource wrappedToolTip}" Content="{TemplateBinding DescriptionValue}"/>
                            </ContentControl.ToolTip>
                        </ContentControl>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="DescriptionValue" Value="{x:Null}">
                            <Setter TargetName="InfoBox" Property="Visibility" Value="Hidden"/>
                        </Trigger>
                        <Trigger Property="LabelValue" Value="{x:Null}">
                            <Setter TargetName="Label" Property="Grid.Column" Value="2" />
                            <Setter TargetName="ContentArea" Property="Grid.Column" Value="1" />
                            <Setter TargetName="InfoBox" Property="Grid.Column" Value="0" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="{x:Type local:ButterflowOption}" BasedOn="{StaticResource butterFlowOptionStyle}" />
    <Style TargetType="ToolTip" x:Key="wrappedToolTip">
        <Setter Property="MaxWidth" Value="300" />
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <ContentPresenter Content="{TemplateBinding Content}">
                        <ContentPresenter.Resources>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="TextWrapping" Value="Wrap" />
                            </Style>
                        </ContentPresenter.Resources>
                    </ContentPresenter>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>