终端一体化运控平台
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

88 rader
5.7 KiB

  1. <UserControl x:Class="BPASmartClient.SCADAControl.CustomerControls.TheWuLiaoControl"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:kj="clr-namespace:BPASmartClient.SCADAControl.Converters"
  7. xmlns:local="clr-namespace:BPASmartClient.SCADAControl.CustomerControls"
  8. mc:Ignorable="d"
  9. x:Name="main"
  10. Width="200" Height="200">
  11. <UserControl.Resources>
  12. <Style x:Key="ListBoxItemCustom" TargetType="ListBoxItem">
  13. <Setter Property="SnapsToDevicePixels" Value="True" />
  14. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  15. <Setter Property="Padding" Value="0" />
  16. <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType=ItemsControl}}" />
  17. <Setter Property="VerticalContentAlignment" Value="Top" />
  18. <Setter Property="Background" Value="Transparent" />
  19. <Setter Property="BorderBrush" Value="Transparent" />
  20. <Setter Property="BorderThickness" Value="0" />
  21. <Setter Property="Template">
  22. <Setter.Value>
  23. <ControlTemplate TargetType="ListBoxItem">
  24. <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
  25. </ControlTemplate>
  26. </Setter.Value>
  27. </Setter>
  28. </Style>
  29. <Style x:Key="ListBoxBaseStyle" TargetType="ListBox">
  30. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  31. <Setter Property="BorderThickness" Value="1" />
  32. <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
  33. <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
  34. <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
  35. <Setter Property="ScrollViewer.PanningMode" Value="Both" />
  36. <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
  37. <Setter Property="VerticalContentAlignment" Value="Center" />
  38. <Setter Property="Padding" Value="2,2,2,0" />
  39. </Style>
  40. <Style x:Key="ListBoxCustom" BasedOn="{StaticResource ListBoxBaseStyle}" TargetType="ListBox">
  41. <Setter Property="ItemContainerStyle" Value="{StaticResource ListBoxItemCustom}" />
  42. <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  43. </Style>
  44. </UserControl.Resources>
  45. <Grid>
  46. <Ellipse Fill="Transparent" Stroke="{Binding Foreground, ElementName=main}" StrokeThickness="{Binding BorderThickness, ElementName=main}" Width="{Binding Width, ElementName=main}" Height="{Binding Width, ElementName=main}"/>
  47. <Viewbox Width="auto" Height="auto" >
  48. <Grid>
  49. <ListBox Background="Transparent" Margin="30" ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl},Path=vs}" Style="{DynamicResource ListBoxCustom}" BorderThickness="0" >
  50. <ListBox.ItemsPanel>
  51. <ItemsPanelTemplate>
  52. <kj:HoneycombPanel />
  53. </ItemsPanelTemplate>
  54. </ListBox.ItemsPanel>
  55. <ListBox.ItemTemplate>
  56. <DataTemplate>
  57. <Grid Width="150" Height="150" Margin="10">
  58. <Ellipse Width="140" Height="140" Fill="Transparent" Stroke="{Binding Foreground, ElementName=main}" StrokeThickness="{Binding BorderThickness, ElementName=main}"/>
  59. <TextBlock Text="一号料仓" Margin="0,-10,0,0" Foreground="{Binding Foreground, ElementName=main}" HorizontalAlignment="Center"></TextBlock>
  60. <Viewbox Width="auto" Height="auto">
  61. <ListBox Background="Transparent" ItemsSource="{Binding dataModel}" Style="{DynamicResource ListBoxCustom}" BorderThickness="0" >
  62. <ListBox.ItemsPanel>
  63. <ItemsPanelTemplate>
  64. <kj:HoneycombPanel />
  65. </ItemsPanelTemplate>
  66. </ListBox.ItemsPanel>
  67. <ListBox.ItemTemplate>
  68. <DataTemplate>
  69. <Grid>
  70. <Ellipse Width="100" Height="100" Fill="Transparent" Stroke="{Binding Foreground, ElementName=main}" StrokeThickness="{Binding BorderThickness, ElementName=main}" Margin="10"/>
  71. <TextBlock HorizontalAlignment="Center" Foreground="{Binding Foreground, ElementName=main}" VerticalAlignment="Center" FontSize="24" Text="味精"></TextBlock>
  72. </Grid>
  73. </DataTemplate>
  74. </ListBox.ItemTemplate>
  75. </ListBox>
  76. </Viewbox>
  77. </Grid>
  78. </DataTemplate>
  79. </ListBox.ItemTemplate>
  80. </ListBox>
  81. </Grid>
  82. </Viewbox>
  83. </Grid>
  84. </UserControl>