|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <UserControl x:Class="BPASmartClient.SCADAControl.CustomerControls.TheWuLiaoControl"
- 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:kj="clr-namespace:BPASmartClient.SCADAControl.Converters"
- xmlns:local="clr-namespace:BPASmartClient.SCADAControl.CustomerControls"
- mc:Ignorable="d"
- x:Name="main"
- Width="200" Height="200">
- <UserControl.Resources>
- <Style x:Key="ListBoxItemCustom" TargetType="ListBoxItem">
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType=ItemsControl}}" />
- <Setter Property="VerticalContentAlignment" Value="Top" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ListBoxItem">
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="ListBoxBaseStyle" TargetType="ListBox">
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
- <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
- <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
- <Setter Property="ScrollViewer.PanningMode" Value="Both" />
- <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Padding" Value="2,2,2,0" />
- </Style>
- <Style x:Key="ListBoxCustom" BasedOn="{StaticResource ListBoxBaseStyle}" TargetType="ListBox">
- <Setter Property="ItemContainerStyle" Value="{StaticResource ListBoxItemCustom}" />
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- </Style>
- </UserControl.Resources>
- <Grid>
- <Ellipse Fill="Transparent" Stroke="{Binding Foreground, ElementName=main}" StrokeThickness="{Binding BorderThickness, ElementName=main}" Width="{Binding Width, ElementName=main}" Height="{Binding Width, ElementName=main}"/>
- <Viewbox Width="auto" Height="auto" >
- <Grid>
-
- <ListBox Background="Transparent" Margin="30" ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl},Path=vs}" Style="{DynamicResource ListBoxCustom}" BorderThickness="0" >
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <kj:HoneycombPanel />
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid Width="150" Height="150" Margin="10">
- <Ellipse Width="140" Height="140" Fill="Transparent" Stroke="{Binding Foreground, ElementName=main}" StrokeThickness="{Binding BorderThickness, ElementName=main}"/>
- <TextBlock Text="一号料仓" Margin="0,-10,0,0" Foreground="{Binding Foreground, ElementName=main}" HorizontalAlignment="Center"></TextBlock>
- <Viewbox Width="auto" Height="auto">
- <ListBox Background="Transparent" ItemsSource="{Binding dataModel}" Style="{DynamicResource ListBoxCustom}" BorderThickness="0" >
- <ListBox.ItemsPanel>
- <ItemsPanelTemplate>
- <kj:HoneycombPanel />
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid>
- <Ellipse Width="100" Height="100" Fill="Transparent" Stroke="{Binding Foreground, ElementName=main}" StrokeThickness="{Binding BorderThickness, ElementName=main}" Margin="10"/>
- <TextBlock HorizontalAlignment="Center" Foreground="{Binding Foreground, ElementName=main}" VerticalAlignment="Center" FontSize="24" Text="味精"></TextBlock>
- </Grid>
- </DataTemplate>
-
- </ListBox.ItemTemplate>
- </ListBox>
- </Viewbox>
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </Grid>
-
- </Viewbox>
- </Grid>
- </UserControl>
|