<fw:BaseWindow x:Class="Com.FirmLib.UI.Maintainer.WinAddLossProductType"
             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"
             xmlns:fw="http://schemas.FWind/xaml"
             xmlns:uc="clr-namespace:Com.FirmLib.UI.Common"
             Name="this" Title="确认提示"
             Height="350" Width="500" WindowStartupLocation="CenterOwner">
    <Grid Margin="5" >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition></RowDefinition>
            <RowDefinition Height="30"></RowDefinition>
        </Grid.RowDefinitions>

        <TextBlock Margin="5,10,0,10" TextWrapping="Wrap" FontSize="16" Text="已选维护设备中，部分型号不在厂家维护范围"></TextBlock>

        <GroupBox Grid.Row="1" Header="是否添加该型号到供应目录中" Margin="3" BorderBrush="Black">

            <ListBox ItemsSource="{Binding ProductTypes}" BorderThickness="0"  ScrollViewer.HorizontalScrollBarVisibility="Disabled" Margin="0,5,0,5">
                <ListBox.ItemsPanel >
                    <ItemsPanelTemplate>
                        <WrapPanel Orientation="Horizontal"  Width="{Binding Path=Width,RelativeSource={RelativeSource AncestorType=ListBox}}"/>
                    </ItemsPanelTemplate>
                </ListBox.ItemsPanel>
                <ListBox.ItemContainerStyle>
                    <Style TargetType="{x:Type ListBoxItem}">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                    <Border Width="150">
                                        <CheckBox IsChecked="{Binding IsChecked,Mode=TwoWay}"  HorizontalAlignment="Stretch">
                                            <CheckBox.Content>
                                                <TextBlock TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Text="{Binding Display}"></TextBlock>
                                            </CheckBox.Content>
                                        </CheckBox>
                                        <Border.ToolTip>
                                            <TextBlock TextWrapping="Wrap" Text="{Binding Display}"></TextBlock>
                                        </Border.ToolTip>
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </ListBox.ItemContainerStyle>
            </ListBox>

        </GroupBox>
        <StackPanel Grid.Row="2" Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
            <Button Command="{Binding Commands.OkCommand}" CommandParameter="{Binding ElementName=this}"  Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}"  Height="23" Width="60"   Content="确定" Click="btnOK_Click"/>
        </StackPanel>
    </Grid>
</fw:BaseWindow>
