<flyctrllib:WindowBigClose x:Class="FLY.Thick.Base.UI.WdIOTip"
                            xmlns:flyctrllib="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
      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" 
      mc:Ignorable="d" 
      xmlns:local="clr-namespace:FLY.Thick.Base.UI"
                           Title="AD盒IO口定义" Height="537" Width="484"  >
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <Style x:Key="IOStyle" TargetType="Rectangle" >
                <Setter Property="Width"  Value="10" />
                <Setter Property="Height"  Value="20" />
                <Setter Property="Margin"  Value="1" />
                <Setter Property="Fill" Value="{StaticResource Brushes.Static}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsOn}" Value="True">
                        <Setter Property="Fill" Value="{StaticResource Brushes.Activity}"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            <Style x:Key="IOTextStyle" TargetType="TextBlock" BasedOn="{StaticResource Styles.Text.FieldContent}">
                <Setter Property="FontSize"  Value="20"/>
                <Setter Property="Width"  Value="30" />
                <Setter Property="Margin"  Value="3" />
            </Style>
            <local:WdIoTipVmUt x:Key="viewModel"/>
        </ResourceDictionary>
    </Window.Resources>

    <Grid TextBlock.FontSize="24" TextBlock.FontStyle="Normal" d:DataContext="{StaticResource viewModel}">
        <StackPanel>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <ItemsControl ItemsSource="{Binding IStatus}" Margin="10">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Margin="2"/>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Rectangle Style="{StaticResource IOStyle}"/>
                                <TextBlock Style="{StaticResource IOTextStyle}" 
                                           Text="{Binding Number}"/>
                                <TextBlock Style="{StaticResource IOTextStyle}" Width="auto" MinWidth="180"
                                           Text="{Binding Desp}"/>
                            </StackPanel>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
                <ItemsControl ItemsSource="{Binding OStatus}" Margin="10" Grid.Column="1">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel/>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Rectangle Style="{StaticResource IOStyle}"/>
                                <TextBlock Style="{StaticResource IOTextStyle}" 
                                           Text="{Binding Number}"/>
                                <TextBlock Style="{StaticResource IOTextStyle}" Width="auto" MinWidth="180" 
                                           Text="{Binding Desp}"/>
                            </StackPanel>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </Grid>
            
        </StackPanel>
        
    </Grid>

</flyctrllib:WindowBigClose>
