终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

122 lines
7.1 KiB

  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls"
  5. xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing">
  6. <Style TargetType="{x:Type control:Dashboard}">
  7. <Setter Property="Value" Value="0" />
  8. <Setter Property="Maximum" Value="120" />
  9. <Setter Property="Minimum" Value="0" />
  10. <Setter Property="PlateBackground" Value="Transparent" />
  11. <Setter Property="Template">
  12. <Setter.Value>
  13. <ControlTemplate TargetType="{x:Type control:Dashboard}">
  14. <Grid>
  15. <Viewbox>
  16. <Border
  17. Background="{TemplateBinding PlateBackground}"
  18. BorderBrush="{TemplateBinding PlateBorderBrush}"
  19. BorderThickness="{TemplateBinding PlateBorderThickness}"
  20. ClipToBounds="True"
  21. CornerRadius="200">
  22. <Grid>
  23. <Canvas
  24. Name="canvasPlate"
  25. Width="400"
  26. Height="400"
  27. Margin="14"
  28. Background="Transparent">
  29. <Canvas.RenderTransform>
  30. <RotateTransform Angle="-45" CenterX="200" CenterY="200" />
  31. </Canvas.RenderTransform>
  32. </Canvas>
  33. <ed:Arc
  34. ArcThickness="24"
  35. ArcThicknessUnit="Pixel"
  36. EndAngle="135.5"
  37. Fill="#45246B"
  38. Opacity="0.1"
  39. StartAngle="-135.5"
  40. Stretch="None"
  41. StrokeEndLineCap="Round"
  42. StrokeStartLineCap="Round" />
  43. <ed:Arc
  44. x:Name="arckd"
  45. ArcThickness="24"
  46. ArcThicknessUnit="Pixel"
  47. EndAngle="50"
  48. Fill="#2E1C5C"
  49. Opacity="0.8"
  50. StartAngle="-135.5"
  51. Stretch="None"
  52. StrokeEndLineCap="Round"
  53. StrokeStartLineCap="Round" />
  54. <!-- 刻度盘当前值对应的圆弧 -->
  55. <Border
  56. Width="240"
  57. Height="240"
  58. Margin="14"
  59. CornerRadius="120"
  60. Opacity="0.5">
  61. <Border.Background>
  62. <RadialGradientBrush RadiusX="1" RadiusY="1">
  63. <GradientStop Offset="0.2" Color="#45246B" />
  64. <GradientStop Offset="0.3" Color="#2E1C5C" />
  65. <GradientStop Offset="0.5" Color="#253192" />
  66. </RadialGradientBrush>
  67. </Border.Background>
  68. </Border>
  69. <Path
  70. Name="pointer"
  71. Margin="14"
  72. Data="M200 205,40 200,200 195,200 205"
  73. RenderTransformOrigin="0.5,0.5">
  74. <Path.Fill>
  75. <RadialGradientBrush RadiusX="1" RadiusY="1">
  76. <GradientStop Offset="0.3" Color="#00C9FF" />
  77. <GradientStop Offset="0.4" Color="#CE97EF" />
  78. <GradientStop Offset="1" Color="#091851" />
  79. </RadialGradientBrush>
  80. </Path.Fill>
  81. <Path.RenderTransform>
  82. <RotateTransform x:Name="rtPointer" Angle="-45" />
  83. </Path.RenderTransform>
  84. </Path>
  85. <Border
  86. Width="80"
  87. Height="80"
  88. Margin="14"
  89. CornerRadius="40">
  90. <Border.Background>
  91. <RadialGradientBrush RadiusX="1" RadiusY="1">
  92. <GradientStop Offset="0.2" Color="#45246B" />
  93. <GradientStop Offset="0.3" Color="#2E1C5C" />
  94. <GradientStop Offset="0.5" Color="#253192" />
  95. </RadialGradientBrush>
  96. </Border.Background>
  97. <StackPanel
  98. HorizontalAlignment="Center"
  99. VerticalAlignment="Center"
  100. Orientation="Vertical">
  101. <TextBlock
  102. x:Name="valueTxt"
  103. HorizontalAlignment="Center"
  104. VerticalAlignment="Center"
  105. FontSize="30" />
  106. <TextBlock
  107. HorizontalAlignment="Center"
  108. VerticalAlignment="Center"
  109. FontSize="12"
  110. Text="km/h" />
  111. </StackPanel>
  112. </Border>
  113. </Grid>
  114. </Border>
  115. </Viewbox>
  116. </Grid>
  117. </ControlTemplate>
  118. </Setter.Value>
  119. </Setter>
  120. </Style>
  121. </ResourceDictionary>