UCSnapInfoView.xaml 5.71 KB
<UserControl x:Class="OS.Spin.View.MainWindowControls.UCSnapInfoView"
             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:local="clr-namespace:OS.Spin.View.MainWindowControls"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800" x:Name="FlawsView" AllowDrop="True">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Style/ScrollViewDictionary.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid x:Name="Panel"  >
        <!--<ScrollViewer  x:Name="BaseScroll" Template="{StaticResource MyScrollViewer}"
                HorizontalScrollBarVisibility="Auto"
                  VerticalScrollBarVisibility="Auto">-->
        <ListBox x:Name="Flaws"  ItemsSource="{Binding ElementName=FlawsView, Path=AllFlaws, IsAsync=True}"  >
            <ListBox.ItemsPanel>
                <ItemsPanelTemplate>
                    <UniformGrid Columns="7"
                        VerticalAlignment="Top" HorizontalAlignment="Left"        IsItemsHost="False" />
                </ItemsPanelTemplate>
            </ListBox.ItemsPanel>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <!--<Border BorderThickness="1" BorderBrush="DarkGray">-->
                    <Grid Width="193" Height="310">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="180"/>
                            <RowDefinition Height="13"/>
                            <RowDefinition Height="97"/>
                            <RowDefinition Height="13"/>
                        </Grid.RowDefinitions>
                        <Canvas x:Name="Snap" Grid.Row="0"  HorizontalAlignment="Center" Tag="{Binding Path=Id}" VerticalAlignment="Center" Width="196" Height="187" MouseDown="Snap_MouseDown">
                            <Canvas.Background>
                                <ImageBrush ImageSource="../images/组 17 拷贝 4.png" Stretch="Fill"/>
                            </Canvas.Background>
                            <TextBlock Width="115.5" Height="114" Block.TextAlignment="Center" Canvas.Left="40" Canvas.Top="32" Padding="5.5,5.5,0,0"><InlineUIContainer>
                                <Image Stretch="Fill" Source="{Binding Path=SnapInfo}" x:Name="logo"/>
                                </InlineUIContainer></TextBlock>

                        </Canvas>

                        <StackPanel Orientation="Vertical" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center" Width="196" Height="97" x:Name="stack">
                            <StackPanel.Background>
                                <ImageBrush ImageSource="../images/形状 1 拷贝 5.png" Stretch="Fill"/>
                            </StackPanel.Background>
                            <StackPanel Orientation="Horizontal" Width="196" Height="32.333333">
                                <TextBlock Foreground="White" FontSize="19" Width="70" Text="编号" Block.TextAlignment="Center" Padding="0,4,0,0"/>
                                <TextBlock Foreground="White" FontSize="19" x:Name="textBlockOne" Block.TextAlignment="Center"  Text="{Binding Path=Id}" Padding="0,4,0,0"/>
                            </StackPanel>

                            <StackPanel Orientation="Horizontal" Width="196" Height="32.333333">
                                <TextBlock Foreground="White" FontSize="19" Width="70" Text="维度" Block.TextAlignment="Center" Padding="0,4,0,0"/>
                                <TextBlock Foreground="White" FontSize="19" x:Name="textBlockTwo" Block.TextAlignment="Center"  Padding="0,4,0,0">
                                    <TextBlock.Text>
                                        <Binding Path="CenterY">
                                            <Binding.Converter>
                                                <local:DoubleToStringConverter>
                                                </local:DoubleToStringConverter>
                                            </Binding.Converter>
                                        </Binding>
                                    </TextBlock.Text>
                                </TextBlock>
                            </StackPanel>

                            <StackPanel Orientation="Horizontal" Width="196" Height="32.333333">
                                <TextBlock Foreground="White" FontSize="19" Width="70"  Text="瑕疵" Block.TextAlignment="Center"  Padding="0,4,0,0"/>
                                <TextBlock Foreground="White" FontSize="19" x:Name="textBlockThree" Block.TextAlignment="Center"  Text="{Binding Path=FlawName}" Padding="0,4,0,0"/>
                            </StackPanel>
                        </StackPanel>
                        <!--<Grid.Background>
                                <ImageBrush ImageSource="/images/clothselect/底图.png" Stretch="Fill"/>
                            </Grid.Background>-->
                    </Grid>
                    <!--</Border>-->
                </DataTemplate>
            </ListBox.ItemTemplate>
            <ListBox.Background>
                <ImageBrush ImageSource="../images/底图.png" Stretch="Fill"/>
            </ListBox.Background>
        </ListBox>
        <!--</ScrollViewer>-->
        <!--<Grid.Background>
            <ImageBrush ImageSource="/images/clothselect/底图.png" Stretch="Fill"/>
        </Grid.Background>-->
    </Grid>
</UserControl>