<Window x:Class="RobotClientWpf.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:RobotClientWpf"
        xmlns:views="clr-namespace:RobotClientWpf.Views"
        xmlns:dj="clr-namespace:DJ;assembly=NLogViewer"
        mc:Ignorable="d" FontSize="15"
        Title="Challenge UI" Height="700" Width="1200" WindowStartupLocation="CenterScreen" ResizeMode="NoResize" Closing="Window_Closing" Loaded="Window_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="200"/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="5,5,5,5" Grid.ColumnSpan="2">
            <Label HorizontalAlignment="Center">MQTT Broker IP:</Label>
            <TextBox x:Name="tbIp" Width="120" Height="25" FontSize="15" TextAlignment="Left" Margin="10 0 0 0">192.168.156.156</TextBox>
            <Button x:Name="btnConnectDisconnect" Content="Connect" Width="100" Margin="20 0 0 0" Click="btnConnectDisconnect_Click"></Button>
        </StackPanel>

        <TabControl Grid.Row="1" x:Name="tabControlMain" Grid.ColumnSpan="2">
            <TabControl.ItemContainerStyle>
                <Style TargetType="{x:Type TabItem}">
                    <Setter Property="Header" Value="{Binding Header}" />
                </Style>
            </TabControl.ItemContainerStyle>
            <TabItem>
                <TabItem.Header>
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/Assets/robot-industrial.png" Height="18" />
                        <TextBlock Text="  Main" Foreground="Green" FontSize="16" />
                    </StackPanel>
                </TabItem.Header>
                <views:MainView x:Name="mainView"/>
            </TabItem>
            <TabItem>
                <TabItem.Header>
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/Assets/cog.png" Height="18" />
                        <TextBlock Text="  Config" Foreground="Blue" FontSize="16"/>
                    </StackPanel>
                </TabItem.Header>
                <views:ConfigView x:Name="configView"/>
            </TabItem>
        </TabControl>

        <dj:NLogViewer Grid.Row="2" Margin="5" DebugForeground="Black" MaxCount="150" ErrorForeground="Black" FatalForeground="Black" TraceForeground="Black" InfoForeground="Black" WarnForeground="Black" >
            <dj:NLogViewer.WarnBackground>
                <SolidColorBrush Color="#FFFF9D00" Opacity="0.5"/>
            </dj:NLogViewer.WarnBackground>
            <dj:NLogViewer.TraceBackground>
                <SolidColorBrush Color="#FF9B9B9B" Opacity="0.5"/>
            </dj:NLogViewer.TraceBackground>
            <dj:NLogViewer.InfoBackground>
                <SolidColorBrush Color="#FF9B9B9B" Opacity="0.5"/>
            </dj:NLogViewer.InfoBackground>
            <dj:NLogViewer.DebugBackground>
                <SolidColorBrush Color="#FF003DC3" Opacity="0.5"/>
            </dj:NLogViewer.DebugBackground>
            <dj:NLogViewer.ErrorBackground>
                <SolidColorBrush Color="#FFFF2E00" Opacity="0.5"/>
            </dj:NLogViewer.ErrorBackground>
            <dj:NLogViewer.FatalBackground>
                <SolidColorBrush Color="Red" Opacity="0.5"/>
            </dj:NLogViewer.FatalBackground>
        </dj:NLogViewer>
        <!--<RichTextBox x:Name="rtbLogs" Grid.Row="2" Margin="10 0 10 0" IsReadOnly="True">
            
        </RichTextBox>-->

        <StackPanel Grid.Row="3" Orientation="Horizontal" Margin="0,150,0,0">
            <TextBlock x:Name="tbBottomMessage" FontSize="15" Margin="10 5"/>
        </StackPanel>
    </Grid>
</Window>
