<!--
SettingsCtrl.xaml
12/4/2023

RAYTHEON PROPRIETARY: THIS DOCUMENT CONTAINS DATA OR INFORMATION
PROPRIETARY TO RAYTHEON COMPANY AND IS RESTRICTED TO USE ONLY BY PERSONS
AUTHORIZED BY RAYTHEON COMPANY IN WRITING TO USE IT. DISCLOSURE TO
UNAUTHORIZED PERSONS WOULD LIKELY CAUSE SUBSTANTIAL COMPETITIVE HARM TO
RAYTHEON COMPANY'S BUSINESS POSITION. NEITHER SAID DOCUMENT NOR ITS
CONTENTS SHALL BE FURNISHED OR DISCLOSED TO OR COPIED OR USED BY PERSONS
OUTSIDE RAYTHEON COMPANY WITHOUT THE EXPRESS WRITTEN APPROVAL OF RAYTHEON
COMPANY.

THIS PROPRIETARY NOTICE IS NOT APPLICABLE IF DELIVERED TO THE U.S. GOVERNMENT

UNPUBLISHED WORK - COPYRIGHT RAYTHEON COMPANY.

WARNING: THIS DOCUMENT CONTAINS TECHNICAL DATA AND / OR TECHNOLOGY WHOSE
EXPORT OR DISCLOSURE TO NON-U.S. PERSONS, WHEREVER LOCATED, IS RESTRICTED
BY THE INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) (22 C.F.R. SECTION
120-130) OR THE EXPORT ADMINISTRATION REGULATIONS (EAR) (15 C.F.R. SECTION
730-774). THIS DOCUMENT CANNOT BE EXPORTED (E.G., PROVIDED TO A SUPPLIER
OUTSIDE OF THE UNITED STATES) OR DISCLOSED TO A NON-U.S. PERSON, WHEREVER
LOCATED, UNTIL A FINAL JURISDICTION AND CLASSIFICATION DETERMINATION HAS
BEEN COMPLETED AND APPROVED BY RAYTHEON, AND ANY REQUIRED U.S. GOVERNMENT
APPROVALS HAVE BEEN OBTAINED. VIOLATIONS ARE SUBJECT TO SEVERE CRIMINAL
PENALTIES.

DOD 5220.22-M, INDUSTRIAL SECURITY MANUAL, CHAPTER 5, SECTION 1 THROUGH 9 :
FOR CLASSIFIED DOCUMENTS FOLLOW THE PROCEDURES IN OR DOD 5200.1-R,
INFORMATION SECURITY PROGRAM, CHAPTER 6. FOR UNCLASSIFIED, LIMITED DOCUMENTS
DESTROY BY ANY  METHOD THAT WILL PREVENT DISCLOSURE OF CONTENTS OR
RECONSTRUCTION OF THE DOCUMENT.
POC: Alex Kravchenko (1118268)
-->
<mah:MetroContentControl x:Class="Raytheon.LogDashboard.View.SettingsCtrl"
             xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
             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:val="clr-namespace:Raytheon.LogDashboard.Validators"
             xmlns:ext="clr-namespace:Raytheon.LogDashboard.Helpers"
             xmlns:mod="clr-namespace:Raytheon.LogDashboard.Model"
             mc:Ignorable="d" 
             d:DesignHeight="800" d:DesignWidth="800">


    <mah:MetroContentControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Styles/Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </mah:MetroContentControl.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="50"/>
        </Grid.RowDefinitions>
        <TabControl BorderThickness="0">
            <TabItem Header="General" Height="45" Width="120">
                <GroupBox FontSize="16">
                    <GroupBox.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="General Settings" FontSize="16" />
                        </DataTemplate>
                    </GroupBox.HeaderTemplate>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="265"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <TextBlock Text="Auto start reading logs at startup:"
                                   ToolTip="Start read logs immediately when application startup" VerticalAlignment="Center" 
                                   Visibility="{Binding Path=EmbeddedMode, Converter={StaticResource BooleanToVisibilityConverter}}"
                                   />
                        <mah:ToggleSwitch Grid.Row="0" Grid.Column="1" IsOn="{Binding Path=IsAutoStartReadAtStartup}"
                                          Style="{DynamicResource MetroCircleToggleButtonStyle}"
                                          Visibility="{Binding Path=EmbeddedMode, Converter={StaticResource BooleanToVisibilityConverter}}"
                                          VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,5,0,0"/>

                        <TextBlock Text="Minimize to Tray Icon:" 
                                   Visibility="{Binding Path=EmbeddedMode, Converter={StaticResource BooleanToVisibilityConverter}}"
                                   ToolTip="Shows a tray icon when LogDashboard is minimized" VerticalAlignment="Center"  
                                   Grid.Row="1"/>
                        <mah:ToggleSwitch Grid.Row="1" Grid.Column="1" 
                                          Visibility="{Binding Path=EmbeddedMode, Converter={StaticResource BooleanToVisibilityConverter}}"
                                          IsOn="{Binding Path=MinimizeToTray}" 
                                          VerticalAlignment="Center" 
                                          HorizontalAlignment="Left" Margin="0,5,0,0"/>

                        <TextBlock Text="Only one instance of application:" ToolTip="Only one instance of LogDashboard running in the system" 
                                   VerticalAlignment="Center"  Grid.Row="2"/>
                        <mah:ToggleSwitch Grid.Row="2" Grid.Column="1" IsOn="{Binding Path=OnlyOneAppInstance}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,5,0,0"/>

                        <TextBlock Text="Show data source column:" ToolTip="Show data source column in log table. Displays where this message came from (file or IP)" VerticalAlignment="Center"  Grid.Row="3"/>
                        
                        <mah:ToggleSwitch 
                            Grid.Row="3" 
                            Grid.Column="1" 
                            IsOn="{Binding Path=IsShowSourceColumn}" 
                            VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,5,0,0"/>

                        <TextBlock Text="Show thread # column:" ToolTip="Show thread number column in log table" VerticalAlignment="Center"  Grid.Row="4"/>
                        <mah:ToggleSwitch 
                            Grid.Row="4" Grid.Column="1" 
                            IsOn="{Binding Path=IsShowThreadColumn}" 
                            VerticalAlignment="Center" 
                            HorizontalAlignment="Left" Margin="0,5,0,0"/>

                        <TextBlock Grid.Row="6" Text="Max message buffer size:" VerticalAlignment="Center" ToolTip="Maximum count of log messages that can be stored in buffer"/>
                        <StackPanel Orientation="Horizontal" Grid.Row="6" Grid.Column="1">
                            <TextBox Width="100" Margin="0,0,10,0" 
                                     FontSize="14"
                                     HorizontalContentAlignment="Left" 
                                     Text="{Binding Path=MaxMessageBufferSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" IsEnabled="{Binding Path=IsEnableMaxMessageBufferSize}"/>
                            <mah:ToggleSwitch IsOn="{Binding Path=IsEnableMaxMessageBufferSize}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,5,0,0"/>
                        </StackPanel>

                        <TextBlock Grid.Row="7" Text="Count of Deleted Messages" VerticalAlignment="Center" 
                                   ToolTip="Count of messages to be deleted if buffer is overflow" 
                                   IsEnabled="{Binding Path=IsEnableMaxMessageBufferSize}"/>
                        <TextBox Grid.Row="7" 
                                 Grid.Column="1" Width="100"  
                                 FontSize="14"
                                 HorizontalAlignment="Left" 
                                 HorizontalContentAlignment="Left" 
                                 Text="{Binding Path=DeletedMessagesCount, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                                 IsEnabled="{Binding Path=IsEnableMaxMessageBufferSize}"/>

                        <TextBlock Grid.Row="8" Text="Displayed date format:" ToolTip="Displayed date format" VerticalAlignment="Center"/>
                        <ComboBox Grid.Row="8" Grid.Column="1" 
                                  Margin="0,5"
                                  FontSize="14"
                                  ItemsSource="{Binding Path=DataFormats}" 
                                  SelectedItem="{Binding Path=SelectedDataFormat}" 
                                  Width="210" 
                                  HorizontalAlignment="Left" 
                                  ToolTip="{Binding Path=ExampleDateTime}"/>

                        <TextBlock Grid.Row="9" Text="Color Theme:" ToolTip="Application Color" VerticalAlignment="Center" 
                                   Visibility="{Binding Path=EmbeddedMode, Converter={StaticResource BooleanToVisibilityConverter}}"/>
                        <ComboBox Grid.Row="9" Grid.Column="1" 
                                  Visibility="{Binding Path=EmbeddedMode, Converter={StaticResource BooleanToVisibilityConverter}}"
                                  FontSize="14"
                                  Margin="0,5"
                                  Height="28"
                                  ItemsSource="{Binding Path=ColorThemes}" 
                                  SelectedIndex="{Binding Path=SelectedColorIndex}"
                                  Width="210" 
                                  HorizontalAlignment="Left">
                            
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <Viewbox>
                                        <TextBlock Text="{Binding Name}"
                                                   Width="210"
                                                   Background="{Binding Color}" 
                                                   Height="20" 
                                                   HorizontalAlignment="Stretch" />
                                    </Viewbox>
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>
                        <TextBlock Grid.Row="10" Text="Theme:" ToolTip="Application Theme" VerticalAlignment="Center"
                                   Visibility="{Binding Path=EmbeddedMode, Converter={StaticResource BooleanToVisibilityConverter}}"/>
                        <ComboBox Grid.Row="10" Grid.Column="1" 
                                  Visibility="{Binding Path=EmbeddedMode, Converter={StaticResource BooleanToVisibilityConverter}}"
                                  FontSize="14"
                                  Margin="0,5"
                                  ItemsSource="{Binding Path=Themes}" 
                                  SelectedItem="{Binding Path=SelectedTheme}" 
                                  Width="210" 
                                  HorizontalAlignment="Left">
                        </ComboBox>

                        <TextBlock Grid.Row="12" Text="Highlight messages by receiver color:" ToolTip="Highlight messages by receiver color" VerticalAlignment="Center" />
                        <mah:ToggleSwitch Grid.Row="12" Grid.Column="1" IsOn="{Binding Path=ShowMessageHighlightByReceiverColor}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,5,0,0"/>

                        <TextBlock Grid.Row="13" Text="Separate UDP Loggers by ports:" ToolTip="Separate UDP loggers by ports" VerticalAlignment="Center" />
                        <mah:ToggleSwitch Grid.Row="13" Grid.Column="1" IsOn="{Binding Path=IsSeparateIPLoggersByPort}" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,5,0,0"/>

                        <TextBlock Grid.Row="14" Text="AutoSave participating receivers:" VerticalAlignment="Center" />
                        <mah:ToggleSwitch Grid.Row="14" Grid.Column="1" 
                                                  Margin="0,5,0,0"
                                                  IsOn="{Binding Path=IsAutoSave}"
                                                  Style="{DynamicResource MetroCircleToggleButtonStyle}"
                                                  VerticalAlignment="Center" 
                                                  HorizontalAlignment="Left"/>

                        <TextBlock Grid.Row="15" 
                                   Visibility="{Binding Path=IsAutoSave, Converter={StaticResource BooleanToVisibilityConverter}}"
                                   Text="Use ErrorLogger Location" 
                                   ToolTip="Track location from the ErrorLogger configuration default location." 
                                   VerticalAlignment="Center" />
                        <mah:ToggleSwitch Grid.Row="15" Grid.Column="1" 
                                   Visibility="{Binding Path=IsAutoSave, Converter={StaticResource BooleanToVisibilityConverter}}"
                                   IsOn="{Binding Path=IsErrorLogger}" 
                                   VerticalAlignment="Center" 
                                   HorizontalAlignment="Left" Margin="0,5,0,0"/>

                        <TextBlock Grid.Row="16" Text="Custom AutoSave Location" 
                                   Visibility="{Binding Path=IsAutoSaveEnabled, Converter={StaticResource BooleanToVisibilityConverter}}"
                                   VerticalAlignment="Center" />
                        
                        <StackPanel Grid.Row="16" Grid.Column="1"
                                    Orientation="Horizontal"
                                    Visibility="{Binding Path=IsAutoSaveEnabled, Converter={StaticResource BooleanToVisibilityConverter}}"
                                    >
                            <TextBox 
                                 Margin="0,10"
                                 MinWidth="200"
                                 Text="{Binding Path=AutoSaveLocation, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                 ToolTip="Please populate with the destination folder or destination folder with the base file name. Use yyyy-mm-dd or yyyy-mm in the path for separating log files by date." />

                            <Button Content="Browse"
                                    Margin="5"
                                    HorizontalAlignment="Right"
                                    Background="{Binding DataContext.IconColor, RelativeSource={RelativeSource AncestorType=mah:MetroWindow}}"
                                    Command="{Binding Path=BrowseLocationCommand}"
                                    />

                        </StackPanel>


                    </Grid>
                </GroupBox>
            </TabItem>
            <TabItem Header="Receivers"
                     Height="45" 
                     Width="120">
                <GroupBox FontSize="16">
                    <GroupBox.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="List of Receivers" FontSize="16"/>
                        </DataTemplate>
                    </GroupBox.HeaderTemplate>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="45"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="220"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>

                        <Border Grid.RowSpan="2"/>

                        <Button Background="{Binding IconColor}" 
                                Width="100" 
                                HorizontalAlignment="Left"
                                BorderThickness="1"
                                Content="Add" Margin="5" 
                                Command="{Binding Path=AddReceiverCommand}"
                                Style="{StaticResource AddButtonStyle}"/>

                        <Button Background="{Binding IconColor}"
                                x:Name="RemoveButton" Width="100" 
                                HorizontalAlignment="Right" 
                                BorderThickness="1"
                                Content="Remove" 
                                Margin="5" 
                                Command="{Binding Path=RemoveReceiverCommand}" 
                                Style="{StaticResource RemoveButtonStyle}"/>

                        <ListBox HorizontalContentAlignment="Stretch" 
                                 Grid.Row="1" Grid.Column="0" Margin="5" 
                                 ItemsSource="{Binding Path=Receivers}" 
                                 SelectedItem="{Binding Path=SelectedReceiver}">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <Grid x:Name="ListItemGrid">
                                        <TextBlock Text="{Binding Path=Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="Auto"/>
                                        <CheckBox IsChecked="{Binding Path=IsActive, Mode=TwoWay}" ToolTip="Is Active" HorizontalAlignment="Right"/>
                                    </Grid>
                                    <DataTemplate.Triggers>
                                        <DataTrigger Binding="{Binding Path=IsActive}" Value="False">
                                            <Setter Property="ListBoxItem.Opacity" Value=".5"/>
                                        </DataTrigger>
                                    </DataTemplate.Triggers>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>

                        <Border Grid.Column="1" Grid.RowSpan="2" Margin="5,0,0,0"/>

                        <StackPanel Orientation="Vertical" 
                                    Grid.RowSpan="2" 
                                    Grid.Column="1" Margin="10,5,10,5" 
                                    Visibility="{Binding Path=IsConfigurationVisible, Converter={StaticResource BooleanToVisibilityConverter}}">
                            <TextBlock Text="" FontWeight="Bold"/>
                            <Grid Margin="0,5,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="120"/>
                                    <ColumnDefinition/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>

                                <TextBlock Grid.Row="0" Text="Receiver Type" VerticalAlignment="Center" />
                                <ComboBox Grid.Column="1"
                                          Margin="0,10"
                                          ItemsSource="{Binding Source={ext:Enumeration {x:Type mod:ReceiverType}}}" 
                                          DisplayMemberPath="Description" 
                                          SelectedValue="{Binding SelectedReceiver.ReceiverType}"
                                          SelectedValuePath="Value"
                                         />

                                <TextBlock Grid.Row="1" Text="Receiver Type" VerticalAlignment="Center" 
                                           Visibility="{Binding Path=SelectedReceiver.IsErrorLogger, Converter={StaticResource BooleanToVisibilityConverter}}"
                                           />
                                <ComboBox Grid.Row="1" Grid.Column="1"
                                          Visibility="{Binding Path=SelectedReceiver.IsErrorLogger, Converter={StaticResource BooleanToVisibilityConverter}}"
                                          Margin="0,10"
                                          ItemsSource="{Binding Source={ext:Enumeration {x:Type mod:ErrorLoggerType}}}" 
                                          DisplayMemberPath="Description" 
                                          SelectedValue="{Binding SelectedReceiver.ErrorLoggerType}"
                                          SelectedValuePath="Value"
                                         />

                                <TextBlock Grid.Row="2" Text="Receiver Name" VerticalAlignment="Center" />
                                <TextBox Grid.Row="2" Grid.Column="1" Margin="0,10" 
                                         Text="{Binding Path=SelectedReceiver.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

                                <TextBlock Grid.Row="3" 
                                           Text="Port Number" VerticalAlignment="Center" 
                                           Visibility="{Binding Path=SelectedReceiver.IsPortVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
                                <TextBox Grid.Row="3" Grid.Column="1" 
                                         Margin="0,10"
                                         Visibility="{Binding Path=SelectedReceiver.IsPortVisible, Converter={StaticResource BooleanToVisibilityConverter}}" >
                                    <TextBox.Text>
                                        <Binding Path="SelectedReceiver.Port" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
                                            <Binding.ValidationRules>
                                                <val:PortNumberValidation ValidatesOnTargetUpdated="True"/>
                                            </Binding.ValidationRules>
                                        </Binding>
                                    </TextBox.Text>
                                </TextBox>

                                <TextBlock Grid.Row="4" Text="Address" VerticalAlignment="Center" 
                                           Visibility="{Binding Path=SelectedReceiver.IsAddressVisible, Converter={StaticResource BooleanToVisibilityConverter}}"/>
                                <TextBox Grid.Row="4" Grid.Column="1" 
                                          Margin="0,10"
                                         Visibility="{Binding Path=SelectedReceiver.IsAddressVisible, Converter={StaticResource BooleanToVisibilityConverter}}"
                                         Text="{Binding Path=SelectedReceiver.Address, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>

                                <TextBlock Grid.Row="5" Text="AutoSave Mode" VerticalAlignment="Center" />
                                <mah:ToggleSwitch Grid.Row="5" Grid.Column="1" 
                                                  Margin="0,10"
                                                  IsEnabled="{Binding IsAutoSave}"
                                                  IsOn="{Binding Path=SelectedReceiver.IsAutoSave, Mode=TwoWay}"
                                                  Style="{DynamicResource MetroCircleToggleButtonStyle}"
                                                  VerticalAlignment="Center" HorizontalAlignment="Left"/>

                            </Grid>
                        </StackPanel>
                    </Grid>
                </GroupBox>
            </TabItem>
            <TabItem Header="Ignored" Height="45" Width="120">
                <GroupBox FontSize="16">
                    <GroupBox.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="Ignored IP Addresses" FontSize="16" />
                        </DataTemplate>
                    </GroupBox.HeaderTemplate>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="45"/>
                            <RowDefinition Height="45"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>

                        <Button Grid.Row="0" 
                                Background="{Binding DataContext.IconColor, RelativeSource={RelativeSource AncestorType=mah:MetroWindow}}"
                                Style="{StaticResource AddIgnoreIpButtonStyle}"/>
                        <Button Grid.Row="0" 
                                Background="{Binding DataContext.IconColor, RelativeSource={RelativeSource AncestorType=mah:MetroWindow}}"
                                Style="{StaticResource RemoveIgnoreIpButtonStyle}"/>

                        <TextBox Grid.Row="1" Style="{StaticResource IPTextBoxStyle}" x:Name="IPAddress">
                            <TextBox.Text>
                                <Binding NotifyOnValidationError="True" Path="TypedIP" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged">
                                    <Binding.ValidationRules>
                                        <val:IPValidation ValidatesOnTargetUpdated="True"/>
                                    </Binding.ValidationRules>
                                </Binding>
                            </TextBox.Text>
                        </TextBox>
                        <Border Grid.RowSpan="3"/>

                        <ListBox Grid.Row="2" Grid.Column="0" Margin="5,20,5,5" 
                                 ItemsSource="{Binding Path=IgnoredIPAddresses}" 
                                 SelectedItem="{Binding Path=SelectedIP}">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <Grid x:Name="ListItemGrid">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="115"/>
                                            <ColumnDefinition/>
                                        </Grid.ColumnDefinitions>
                                        <TextBlock Grid.Column="0" Text="{Binding Path=IP, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Width="Auto"/>
                                        <CheckBox VerticalAlignment="Bottom" Grid.Column="1" 
                                                  IsChecked="{Binding Path=IsActive, Mode=TwoWay}" 
                                                  ToolTip="Is Active" HorizontalAlignment="Right"/>
                                    </Grid>
                                    <DataTemplate.Triggers>
                                        <DataTrigger Binding="{Binding Path=IsActive}" Value="False">
                                            <Setter Property="ListBoxItem.Opacity" Value="0.5"/>
                                        </DataTrigger>
                                    </DataTemplate.Triggers>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </Grid>
                </GroupBox>
            </TabItem>
            <TabItem Header="About" Width="100" Height="45">
                <GroupBox FontSize="16">
                    <GroupBox.HeaderTemplate>
                        <DataTemplate>
                            <TextBlock Text="About" FontSize="16"/>
                        </DataTemplate>
                    </GroupBox.HeaderTemplate>

                    <StackPanel Orientation="Vertical">
                        <TextBlock HorizontalAlignment="Center" Text="Log Dashboard"/>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="Version: " FontWeight="Bold"/>
                            <TextBlock Text="{Binding Path=Version}"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock VerticalAlignment="Center" Text="Author: " FontWeight="Bold"/>
                            <TextBlock VerticalAlignment="Center" Text="Alex Kravchenko (Common Platforms)"/>
                        </StackPanel>
                        <TextBlock Text="LogDashboard Features" HorizontalAlignment="Left"/>
                        <Border BorderThickness="1" Margin="0,5" Padding="10">
                            <StackPanel Orientation="Vertical">
                                <TextBlock Text="- Reads log files via log4j template, standard NLog format" HorizontalAlignment="Left"/>
                                <TextBlock Text="- Reads Error Logger messages via Mail Slots" HorizontalAlignment="Left"/>
                                <TextBlock Text="- Reads Windows Debug messages" HorizontalAlignment="Left"/>
                                <TextBlock Text="- Export and import log files" HorizontalAlignment="Left"/>
                                <TextBlock Text="- Sorting and filtering received logs" HorizontalAlignment="Left"/>
                                <TextBlock Text="- Other features (for details see ReleaseNotes)." HorizontalAlignment="Left"/>
                            </StackPanel>
                        </Border>
                        <Button Content="Show Release Notes"
                                Background="{Binding DataContext.IconColor, RelativeSource={RelativeSource AncestorType=mah:MetroWindow}}"
                                Command="{Binding Path=ShowReleaseNotesCommand}" Height="35" Width="200"/>
                    </StackPanel>
                </GroupBox>
            </TabItem>
        </TabControl>

        <Button Grid.Row="1" Grid.ColumnSpan="2" 
                Width="105" 
                HorizontalAlignment="Right" 
                Margin="0,0,140,0" 
                Background="{Binding IconColor}"
                Content="Save" 
                Command="{Binding Path=SaveCommand}" 
                CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=mah:MetroWindow}}" />

        <Button Grid.Row="1" Grid.ColumnSpan="2" 
                Width="105" 
                HorizontalAlignment="Right" 
                Margin="120,0,20,0" 
                Background="{Binding IconColor}"
                Content="Cancel" 
                Command="{Binding Path=CancelCommand}" 
                CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=mah:MetroWindow}}"/>
    </Grid>
</mah:MetroContentControl>
