<Window x:Class="LogDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:host="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"   
        xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
        Title="{StaticResource ID_TITLE}" Height="580" Width="900" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize" Background="WhiteSmoke">
    <Window.Resources>
        <Style TargetType="{x:Type ListViewItem}">
            <Setter Property="Height" Value="30" />
        </Style>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="80" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <GroupBox Header="{StaticResource ID_DEV_LOGIN}" Margin="5">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="140" />
                        <ColumnDefinition Width="130" />
                        <ColumnDefinition Width="180" />
                        <ColumnDefinition Width="180" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid Grid.Column="0">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                            <TextBlock Text="{StaticResource ID_IP}" VerticalAlignment="Center" Margin="3,0,0,0"/>
                            <TextBox x:Name="ip_textbox" Text="171.35.0.136" Width="120" Height="25" Margin="2,0,0,0"/>
                        </StackPanel>
                    </Grid>
                    <Grid Grid.Column="1">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                            <TextBlock Text="{StaticResource ID_PORT}" VerticalAlignment="Center" />
                            <TextBox x:Name="port_textbox" Text="37777" Width="80" Height="25" Margin="2,0,0,0" PreviewTextInput="Port_TextInput"/>
                        </StackPanel>
                    </Grid>
                    <Grid Grid.Column="2">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                            <TextBlock Text="{StaticResource ID_USERNAME}" VerticalAlignment="Center"/>
                            <TextBox x:Name="username_textbox" Text="admin" Width="120" Height="25" Margin="2,0,0,0"/>
                        </StackPanel>
                    </Grid>
                    <Grid Grid.Column="3">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                            <TextBlock Text="{StaticResource ID_PASSWORD}" VerticalAlignment="Center"/>
                            <PasswordBox x:Name="password_textbox" Password="admin" Width="120" Height="25" Margin="2,0,0,0"/>
                        </StackPanel>
                    </Grid>
                    <Grid Grid.Column="4">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                            <Button x:Name="login_btn" Content="{StaticResource ID_LOGIN}" Width="100" Height="30" Margin="5,0,0,0" Click="Login_Clicked"/>
                            <Button x:Name="logout_btn" Content="{StaticResource ID_LOGOUT}" Width="100" Height="30" Margin="10,0,0,0" Click="Logout_Clicked"/>
                        </StackPanel>
                    </Grid>
                </Grid>
            </GroupBox>
            
        </Grid>
        <Grid Grid.Row="1">
            <GroupBox Header="{StaticResource ID_QUERYLOG}" Margin="5">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="50" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <Grid Grid.Row="0">
                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                            <ComboBox x:Name="type_comboBox" Width="140" Height="25" Margin="5,0,0,0"/>
                            <WindowsFormsHost Margin="20,0,0,0">
                                <wf:DateTimePicker x:Name="startTimeD_Picker" Format="Custom" CustomFormat="yyyy/MM/dd" ShowUpDown="False" Width="100"/>
                            </WindowsFormsHost>
                            <WindowsFormsHost Margin="5,0,0,0">
                                <wf:DateTimePicker x:Name="startTime_Picker" Format="Custom" CustomFormat="HH:mm:ss" ShowUpDown="True" Width="80"/>
                            </WindowsFormsHost>
                            <TextBlock Text=" - " HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            <WindowsFormsHost Margin="10,0,0,0">
                                <wf:DateTimePicker x:Name="endTimeD_Picker" Format="Custom" CustomFormat="yyyy/MM/dd" ShowUpDown="False" Width="100"/>
                            </WindowsFormsHost>
                            <WindowsFormsHost Margin="5,0,0,0">
                                <wf:DateTimePicker x:Name="endTime_Picker" Format="Custom" CustomFormat="HH:mm:ss" ShowUpDown="True" Width="80"/>
                            </WindowsFormsHost>
                            <Button x:Name="query_btn" Content="{StaticResource ID_QUERY}" Width="80" Height="28" Margin="20,0,0,0" Click="Query_Clicked"/>
                            <Button x:Name="prepage_btn" Content="{StaticResource ID_PREPAGE}" Width="80" Height="28" Margin="20,0,0,0" Click="PrePage_Clicked"/>
                            <Button x:Name="nextpage_btn" Content="{StaticResource ID_NEXTPAGE}" Width="80" Height="28" Margin="10,0,0,0" Click="NextPage_Clicked"/>
                        </StackPanel>
                    </Grid>
                    <Grid Grid.Row="1">
                        <ListView x:Name="log_listview" Margin="-5,-3,-5,-5">
                            <ListView.View>
                                <GridView>
                                    <GridViewColumn Header="{StaticResource ID_ID}" Width="40" DisplayMemberBinding="{Binding ID}"/>
                                    <GridViewColumn Header="{StaticResource ID_TYPE}" Width="200" DisplayMemberBinding="{Binding LOGTYPE}"/>
                                    <GridViewColumn Header="{StaticResource ID_TIME}" Width="200" DisplayMemberBinding="{Binding TIME}"/>
                                    <GridViewColumn Header="{StaticResource ID_CONTENT}" Width="auto" DisplayMemberBinding="{Binding LOGCONTENT}"/>
                                </GridView>
                            </ListView.View>
                        </ListView>
                    </Grid>
                </Grid>
            </GroupBox>
        </Grid>
    </Grid>
</Window>
