<?xml version="1.0" encoding="UTF-8" ?>
<ResourceDictionary xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
                    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                    xmlns:controls="clr-namespace:Bit.App.Controls"
                    xmlns:u="clr-namespace:Bit.App.Utilities"
                    x:Class="Bit.App.Styles.ControlTemplates">

    <u:StringHasValueConverter x:Key="stringHasValueConverter" />
    <u:BoolEnablementToTextColorConverter x:Key="boolEnablementToTextColorConverter" />

    <ControlTemplate x:Key="SettingControlTemplate">
        <Grid
            RowDefinitions="Auto,*"
            ColumnDefinitions="*,Auto"
            ColumnSpacing="10">
            <controls:TruncatedMultilineCustomLabel
                Grid.Row="0"
                Grid.Column="0"
                MaxLines="2"
                Text="{TemplateBinding Title}"
                TextColor="{TemplateBinding IsEnabled, Converter={StaticResource boolEnablementToTextColorConverter}}"
                HorizontalOptions="StartAndExpand"
                LineBreakMode="TailTruncation" />

            <ContentPresenter
                Grid.Column="1"
                Grid.RowSpan="2"
                HorizontalOptions="End"
                VerticalOptions="Center" />

            <Label
                Grid.Row="1"
                Text="{TemplateBinding Subtitle}"
                IsVisible="{TemplateBinding Subtitle, Converter={StaticResource stringHasValueConverter}}"
                StyleClass="box-footer-label, box-footer-label-switch"
                Margin="0,0,0,0"/>
        </Grid>
    </ControlTemplate>
</ResourceDictionary>
