<?xml version="1.0" encoding="utf-8" ?>
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:RodelAgent.UI.Controls"
    xmlns:ext="using:RodelAgent.UI.Extensions"
    xmlns:ic="using:FluentIcons.WinUI"
    xmlns:local="using:RodelAgent.UI.Controls.Items">
    <Style TargetType="local:ChatGroupItemControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ChatGroupItemControl">
                    <controls:CardPanel
                        x:Name="RootCard"
                        HorizontalAlignment="Stretch"
                        Background="Transparent"
                        BorderBrush="Transparent"
                        IsChecked="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=ViewModel.IsSelected}"
                        ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=ViewModel.Title}">
                        <Grid Padding="12,8" ColumnSpacing="8">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <TextBlock
                                MaxLines="1"
                                Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=ViewModel.Title}"
                                TextTrimming="CharacterEllipsis"
                                TextWrapping="NoWrap" />
                            <TextBlock
                                Grid.Column="1"
                                VerticalAlignment="Center"
                                Foreground="{ThemeResource TextFillColorTertiaryBrush}"
                                Style="{StaticResource CaptionTextBlockStyle}"
                                Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=ViewModel.LastMessageTime}"
                                Visibility="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=ViewModel.LastMessageTime, Converter={StaticResource ObjectToVisibilityConverter}}" />
                        </Grid>
                    </controls:CardPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
