<Window x:Class="RealLoadPicDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="{StaticResource ID_TITLE}" Height="600" Width="930" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize" Background="WhiteSmoke">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="310" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="280"/>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid Grid.Column="0" >
                <Border BorderBrush="Gray" BorderThickness="1" CornerRadius="2" Margin="5,10,5,2">
                    <Grid >
                        <StackPanel >
                            <StackPanel Margin="0,10,0,10" Orientation="Horizontal" HorizontalAlignment="Right">
                                <TextBlock Text="{StaticResource ID_IP_ADDRESS}" />
                                <TextBox x:Name="ip_tb" Margin="10,0,10,0" Text="192.168.4.1" Width="180" Height="25" FontSize="12"/>
                            </StackPanel>
                            <StackPanel Margin="0,10,0,10" Orientation="Horizontal" HorizontalAlignment="Right">
                                <TextBlock Text="{StaticResource ID_PORT}" />
                                <TextBox x:Name="port_tb" Margin="10,0,10,0" Text="37777" Width="180" Height="25" FontSize="12" PreviewTextInput="Port_Input"/>
                            </StackPanel>
                            <StackPanel Margin="0,10,0,10" Orientation="Horizontal" HorizontalAlignment="Right">
                                <TextBlock Text="{StaticResource ID_USERNAME}"/>
                                <TextBox x:Name="username_tb" Margin="10,0,10,0" Text="admin" Width="180" Height="25" FontSize="12"/>
                            </StackPanel>
                            <StackPanel Margin="0,10,0,10" Orientation="Horizontal" HorizontalAlignment="Right">
                                <TextBlock Text="{StaticResource ID_PASSWORD}" />
                                <PasswordBox x:Name="password_tb" Margin="10,0,10,0" Password="admin" Width="180" Height="25" FontSize="12"/>
                            </StackPanel>
                            <StackPanel Margin="0,10,0,0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
                                <Button x:Name="add_device_bt" Content="{StaticResource ID_BTN_ADDDEVICE}" Width="120" Height="25" Click="AddDevice_Clicked"/>
                                <Button x:Name="del_device_bt" Content="{StaticResource ID_BTN_DELDEVICE}" Width="120" Height="25" Margin="10,0,0,0" Click="DelDevice_Clicked"/>
                            </StackPanel>
                            <StackPanel Margin="0,10,0,0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
                                <Button x:Name="start_bt" Content="{StaticResource ID_BTN_START}" Width="120" Height="25" Click="Start_Clicked"/>
                                <Button x:Name="stop_bt" Content="{StaticResource ID_BTN_STOP}" Width="120" Height="25" Margin="10,0,0,0" Click="Stop_Clicked"/>
                            </StackPanel>
                            <StackPanel Margin="0,10,0,0" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
                                <Button x:Name="import_bt" Content="{StaticResource ID_BTN_IMPORT}" Width="120" Height="25" Click="Import_Clicked"/>
                                <Button x:Name="export_bt" Content="{StaticResource ID_BTN_EXPORT}" Width="120" Height="25" Click="Export_Clicked" Margin="10,0,0,0"/>
                            </StackPanel>
                        </StackPanel>
                    </Grid>
                </Border>
            </Grid>
            <Grid Grid.Column="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="195" />
                    <ColumnDefinition Width="55" />
                    <ColumnDefinition Width="195" />
                    <ColumnDefinition Width="195" />
                </Grid.ColumnDefinitions>
                <Grid Grid.Column="0" >
                    <GroupBox x:Name="wait_header" Header="{StaticResource ID_WAITING}" Margin="2" BorderBrush="Gray">
                        <ListBox x:Name="wait_listbox" SelectionMode="Single" />
                    </GroupBox>
                </Grid>
                <Grid Grid.Column="1" >
                    <Button x:Name="towait_btn" Content="&lt;-" Width="40" Height="100" VerticalAlignment="Center" HorizontalAlignment="Center" Click="ToWait_Click"/>
                </Grid>
                <Grid Grid.Column="2" >
                    <GroupBox x:Name="failed_header" Header="{StaticResource ID_FAILED}" Margin="2,0,5,2" BorderBrush="Gray">
                        <ListBox x:Name="faild_listbox" />
                    </GroupBox>
                </Grid>
                <Grid Grid.Column="3" >
                    <GroupBox x:Name="connected_header" Header="{StaticResource ID_CONNECTED}" Margin="2" BorderBrush="Gray">
                        <ListBox x:Name="connected_listbox"/>
                    </GroupBox>
                </Grid>
            </Grid>
            
        </Grid>
        <Grid Grid.Row="1">
            <GroupBox Header="{StaticResource ID_MESSAGE_EVENT}" Margin="5,0,5,5" BorderBrush="Gray">
                <TabControl Margin="-5,0,-5,-5">
                    <TabItem Header="{StaticResource ID_DEVICE_EVENT}" >
                        <ListView x:Name="event_listview" Margin="-5,-3,-5,-5">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn Header="{StaticResource ID_ID}" Width="50" DisplayMemberBinding="{Binding ID}"/>
                                    <GridViewColumn Header="{StaticResource ID_DATETIME}" Width="200" DisplayMemberBinding="{Binding Time}"/>
                                    <GridViewColumn Header="{StaticResource ID_IP}" Width="120" DisplayMemberBinding="{Binding IP}"/>
                                    <GridViewColumn Header="{StaticResource ID_CHANNEL}" Width="80" DisplayMemberBinding="{Binding Channel}"/>
                                    <GridViewColumn Header="{StaticResource ID_EVENT_TYPE}" Width="120" DisplayMemberBinding="{Binding Type}"/>
                                    <GridViewColumn Header="{StaticResource ID_MESSAGE}" Width="300" DisplayMemberBinding="{Binding Message}"/>
                                </GridView>
                            </ListView.View>
                        </ListView>
                    </TabItem>
                    <TabItem Header="{StaticResource ID_PERFORMANCE}">
                        <ListView x:Name="performance_listView" Margin="-5,-3,-5,-5">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn Header="{StaticResource ID_DATETIME}" Width="200" DisplayMemberBinding="{Binding Time}" />
                                    <GridViewColumn Header="{StaticResource ID_EVENT_LENGTH}" Width="200" DisplayMemberBinding="{Binding Count}" />
                                </GridView>
                            </ListView.View>
                        </ListView>
                    </TabItem>
                    <TabItem Header="{StaticResource ID_ERROR_LOG}">
                        <ListView x:Name="error_listView" Margin="-5,-3,-5,-5">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn Header="{StaticResource ID_ID}" DisplayMemberBinding="{Binding ID}" Width="50"/>
                                    <GridViewColumn Header="{StaticResource ID_DATETIME}" DisplayMemberBinding="{Binding Time}" Width="200"/>
                                    <GridViewColumn Header="{StaticResource ID_IP}" DisplayMemberBinding="{Binding IP}" Width="100"/>
                                    <GridViewColumn Header="{StaticResource ID_CHANNEL}" DisplayMemberBinding="{Binding ChannelNumber}" Width="80"/>
                                    <GridViewColumn Header="{StaticResource ID_ERROR_TYPE}" DisplayMemberBinding="{Binding ErrorType}" Width="120"/>
                                    <GridViewColumn Header="{StaticResource ID_ERROR_CODE}" DisplayMemberBinding="{Binding ErrorCode}" Width="100"/>
                                    <GridViewColumn Header="{StaticResource ID_ERROR_MESSAGE}" DisplayMemberBinding="{Binding ErrorMessage}" Width="300"/>
                                </GridView>
                            </ListView.View>
                        </ListView>
                    </TabItem>
                </TabControl>
            </GroupBox>
        </Grid>
    </Grid>
</Window>
