<Window x:Class="ThermalCamera.window.HeatMapWnd"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:wnd="clr-namespace:ThermalCamera.ViewModel"
        xmlns:tri="http://schemas.microsoft.com/expression/2010/interactivity"
        Title="HeatMapWnd(热图获取)" Height="420" Width="300"
        ResizeMode="NoResize" ShowInTaskbar="False"
        WindowStartupLocation="CenterOwner">
    <tri:Interaction.Triggers>
        <tri:EventTrigger EventName="Closed">
            <tri:InvokeCommandAction Command="{Binding ClosedCmd}"/>
        </tri:EventTrigger>
    </tri:Interaction.Triggers>
    <Window.DataContext>
        <wnd:HeatMapViewModel/>
    </Window.DataContext>
    <Grid>
        <StackPanel Margin="5">
            <GroupBox Header="Attach(订阅)">
                <StackPanel>
                    <WrapPanel HorizontalAlignment="Center">
                        <TextBlock Text="Channel(通道):" Width="100" VerticalAlignment="Center" Margin="10,0"/>
                        <TextBox Width="100" Text="{Binding AttachChannel}" PreviewTextInput="TextBox_PreviewTextInput"/>
                    </WrapPanel>
                    <WrapPanel Margin="5" HorizontalAlignment="Center">
                        <Button Content="Attach(订阅)" Width="80" Height="25" Margin="5" Command="{Binding AttachCmd}" IsEnabled="{Binding AttachEn}"/>
                        <Button Content="Detach(取消)" Width="80" Height="25" Margin="5" Command="{Binding DetachCmd}" IsEnabled="{Binding DetachEn}"/>
                    </WrapPanel>
                </StackPanel>
            </GroupBox>
            <GroupBox Header="Heat map metadata info(热图元数据信息)">
                <StackPanel>
                    <WrapPanel Margin="5" HorizontalAlignment="Center">
                        <TextBlock Text="Height(高度):" Width="100" Margin="10,0" VerticalAlignment="Center"/>
                        <TextBox Width="100" Text="{Binding Height, Mode=TwoWay}" IsReadOnly="True"/>
                    </WrapPanel>
                    <WrapPanel Margin="5,0" HorizontalAlignment="Center">
                        <TextBlock Text="Width(宽度):" Width="100" Margin="10,0" VerticalAlignment="Center"/>
                        <TextBox Width="100" Text="{Binding Width, Mode=TwoWay}" IsReadOnly="True"/>
                    </WrapPanel>
                    <WrapPanel Margin="5" HorizontalAlignment="Center">
                        <TextBlock Text="Channel(通道):" Width="100" Margin="10,0" VerticalAlignment="Center"/>
                        <TextBox Width="100" Text="{Binding Channel, Mode=TwoWay}" IsReadOnly="True"/>
                    </WrapPanel>
                    <WrapPanel Margin="5,0" HorizontalAlignment="Center">
                        <TextBlock Text="Time(时间):" Width="100" Margin="10,0" VerticalAlignment="Center"/>
                        <TextBox Width="100" Text="{Binding Time, Mode=TwoWay}" IsReadOnly="True"/>
                    </WrapPanel>
                    <WrapPanel Margin="5" HorizontalAlignment="Center">
                        <TextBlock Text="Length(数据大小):" Width="100" Margin="10,0" VerticalAlignment="Center"/>
                        <TextBox Width="100" Text="{Binding Length, Mode=TwoWay}" IsReadOnly="True"/>
                    </WrapPanel>
                    <WrapPanel Margin="5,0" HorizontalAlignment="Center">
                        <TextBlock Text="SensorType(类型):" Width="100" Margin="10,0" VerticalAlignment="Center"/>
                        <TextBox Width="100" Text="{Binding SensorType, Mode=TwoWay}" IsReadOnly="True"/>
                    </WrapPanel>
                </StackPanel>
            </GroupBox>
            <GroupBox Header="Fetch(获取)">
                <StackPanel>
                    <WrapPanel Margin="5" HorizontalAlignment="Center">
                        <TextBlock Text="Status(状态):" Width="100" VerticalAlignment="Center" Margin="10,0"/>
                        <TextBox Width="100" Text="{Binding Status}" IsReadOnly="True"/>
                    </WrapPanel>
                    <WrapPanel Margin="5" HorizontalAlignment="Center">
                        <Button Content="Fetch(获取)" Width="80" Height="25" Command="{Binding FetchCmd}"/>
                    </WrapPanel>
                </StackPanel>
            </GroupBox>
        </StackPanel>
    </Grid>
</Window>
