<UserControl x:Class="FasdDesktopUi.Basics.UserControls.CustomSearchResultCollection"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:FasdDesktopUi.Basics.UserControls"
             xmlns:vc="clr-namespace:FasdDesktopUi.Basics.Converter"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800"
             x:Name="CustomSearchResultUc">

    <UserControl.Resources>
        <vc:NullValueToVisibilityConverter x:Key="NullToVisibility" />
        <vc:LanguageDefinitionsConverter x:Key="LanguageConverter" />
    </UserControl.Resources>

    <Border x:Name="MainBorder" x:FieldModifier="private">
        <Grid x:Name="MainGrid" x:FieldModifier="private">

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <TextBlock x:Name="HeaderTextBlock" x:FieldModifier="private"
                       Grid.Column="0"
                       Style="{DynamicResource DetailsPage.DataHistory.TitleColumn.OverviewTitle}"
                       HorizontalAlignment="Left"
                       Margin="5 0 0 5"/>

            <CheckBox x:Name="ShowDetailsCheckBox" x:FieldModifier="private"
                      Style="{DynamicResource ToggleSwitch}"
                      IsChecked="{Binding ElementName=CustomSearchResultUc, Path=ShowSearchResultDetails}"
                      Grid.Column="1"
                      Margin="5 0"
                      VerticalAlignment="Center"
                      ToolTip="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=SearchBar.ShowDetails}"
                      Cursor="Hand"
                      Checked="ShowDetailsCheckBox_Checked"
                      Unchecked="ShowDetailsCheckBox_Checked"/>

            <ScrollViewer x:Name="MainScrollViewer" x:FieldModifier="private"
                          VerticalScrollBarVisibility="Auto"
                          Grid.Row="1"
                          Grid.ColumnSpan="2">
                <StackPanel x:Name="MainStackPanel" x:FieldModifier="private"
                            Grid.IsSharedSizeScope="True"/>
            </ScrollViewer>

        </Grid>
    </Border>

</UserControl>
