<UserControl x:Class="SyncTrayzor.Pages.ConsoleView"
             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:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:l="clr-namespace:SyncTrayzor.Localization"
             mc:Ignorable="d" 
             xmlns:s="https://github.com/canton7/Stylet"
             xmlns:xaml="clr-namespace:SyncTrayzor.Xaml"
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <xaml:LogMessageListToStringConverter x:Key="LogMessagesConverter"/>
    </UserControl.Resources>
    <DockPanel>
        <DockPanel DockPanel.Dock="Top" LastChildFill="False" Height="27">
            <TextBlock DockPanel.Dock="Left" Margin="10,0,0,0" VerticalAlignment="Center" FontWeight="Bold" Text="{l:Loc ConsoleView_Title}"/>
            <Button DockPanel.Dock="Right" Padding="3,0" Margin="0,3,5,3" Height="NaN" MinWidth="50" Command="{s:Action ShowSettings}" Content="{l:Loc ConsoleView_SettingsButton}"/>
            <Button DockPanel.Dock="Right" Padding="3,0" Margin="0,3,5,3" Height="NaN" MinWidth="50" Command="{s:Action ClearLog}" Content="{l:Loc ConsoleView_ClearButton}"/>
            <Button DockPanel.Dock="Right" Padding="3,0" Margin="0,3,5,3" Height="NaN" MinWidth="50" Command="{s:Action PauseLog}" Content="{l:Loc ConsoleView_PauseButton}" Visibility="{Binding LogPaused, Converter={x:Static s:BoolToVisibilityConverter.InverseInstance}}"/>
            <Button DockPanel.Dock="Right" Padding="3,0" Margin="0,3,5,3" Height="NaN" MinWidth="50" Command="{s:Action ResumeLog}" Content="{l:Loc ConsoleView_ResumeButton}" Visibility="{Binding LogPaused, Converter={x:Static s:BoolToVisibilityConverter.Instance}}"/>
        </DockPanel>
        <TextBox ScrollViewer.VerticalScrollBarVisibility="Auto"
                 ScrollViewer.HorizontalScrollBarVisibility="Auto"
                 FontFamily="Consolas"
                 FontSize="11"
                 IsReadOnly="True"
                 UndoLimit="0"
                 Text="{Binding LogMessages, Converter={StaticResource LogMessagesConverter}, Mode=OneWay}"
                 FlowDirection="LeftToRight">
            <i:Interaction.Behaviors>
                <xaml:ScrollToEndBehaviour/>
            </i:Interaction.Behaviors>
        </TextBox>
    </DockPanel>
</UserControl>
