<Window x:Class="MeterVision.Dlg.ViewRealLogDlg"
        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:MeterVision.Dlg"
        mc:Ignorable="d"
        Background="WhiteSmoke"
        ShowInTaskbar="False"
        WindowStartupLocation="CenterOwner"
        ResizeMode="CanResizeWithGrip"
        Title="查看实时记录的日志" Height="768" Width="1024">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="40" />
        </Grid.RowDefinitions>

        <Grid Grid.Row="0" Margin="10">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="220" />
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="30" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <TextBlock Grid.Row="0" Grid.Column="0" Text="{Binding TotalRecords,StringFormat='已记录的实时日志列表({0})'}" VerticalAlignment="Center" FontSize="14px" />

            <ListView Grid.Row="1" Grid.Column="0" x:Name="lvFileName" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
                                  Foreground="#000000" FontSize="13px"
                      SelectedItem="{Binding SelectedFileInfo,Mode=TwoWay}"
                      SelectionChanged="LvFileName_SelectionChanged">
                <ListView.ItemContainerStyle>
                    <Style TargetType="ListViewItem">
                        <!-- 设置行高 -->
                        <Setter Property="Height" Value="30"/>
                        <!-- 设置字体大小 -->
                        <Setter Property="FontSize" Value="14"/>
                        <Setter Property="BorderBrush" Value="#D3D3D3"/>
                        <Setter Property="BorderThickness" Value="0,0,0,1"/>
                    </Style>
                </ListView.ItemContainerStyle>
                <ListView.View>
                    <GridView>
                        <GridView.ColumnHeaderContainerStyle>
                            <Style TargetType="GridViewColumnHeader">
                                <Setter Property="FontSize" Value="14"/>
                                <!-- 字体大小 -->
                                <Setter Property="Height" Value="30"/>
                                <!-- 高度 --><!--
                                <Setter Property="Background" Value="LightGray"/>
                                --><!-- 背景色 --><!--
                                <Setter Property="Foreground" Value="Black"/>
                                --><!-- 文字颜色 --><!--
                                <Setter Property="HorizontalContentAlignment" Value="Center"/>
                                --><!-- 居中对齐 -->
                            </Style>
                        </GridView.ColumnHeaderContainerStyle>
                        <GridViewColumn Header="文件名称" Width="200"  DisplayMemberBinding="{Binding Name}" />
                    </GridView>
                </ListView.View>
            </ListView>

            <TextBlock Grid.Row="0" Grid.Column="2" Text="{Binding SelectedFileInfo.Name,StringFormat='文件名称: {0}'}" VerticalAlignment="Center" FontSize="14px" />
            
            <Border Grid.Row="1" Grid.Column ="2">
                <RichTextBox Name="RichTxtContentBox" Grid.Column="1" IsReadOnly="True" 
                                 VerticalScrollBarVisibility="Auto" 
                                 FontSize="14px" BorderThickness="1"
                                 Margin="0"/>
            </Border>

        </Grid>

        <Border Grid.Row="1" Background="WhiteSmoke" BorderThickness="0 1 0 0" BorderBrush="#D3D3D3">
            <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
                <!--<Button Name="btnOK" Content="确定" HorizontalAlignment="Center" Margin="0 0 20 0"
                    VerticalAlignment="Center" Width="80" Height="26" Click="BtnOK_Click" />-->
                <Button Name="btnClose" Content="关闭" HorizontalAlignment="Center" 
                    VerticalAlignment="Center" Width="80" Height="26" Click="BtnClose_Click" />
            </StackPanel>
        </Border>
    </Grid>
</Window>
