终端一体化运控平台
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

115 righe
4.7 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.CustomResource.UserControls.TechnologyInstrument"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
  7. xmlns:interactivity="http://schemas.microsoft.com/xaml/behaviors"
  8. xmlns:local="clr-namespace:BPASmartClient.CustomResource.UserControls"
  9. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  10. d:DesignHeight="300"
  11. d:DesignWidth="300"
  12. mc:Ignorable="d">
  13. <Viewbox>
  14. <Canvas Width="300" Height="300">
  15. <!-- 外边框和内边框进度 -->
  16. <Grid Width="300" Height="300">
  17. <!-- 外边框 -->
  18. <Ellipse Stroke="#0578f1" StrokeThickness="10">
  19. <interactivity:Interaction.Behaviors>
  20. <local:EllipseProgressBehavior
  21. EndAngle="137"
  22. Progress="100"
  23. StartAngle="-137" />
  24. </interactivity:Interaction.Behaviors>
  25. </Ellipse>
  26. <!-- 进度边框 -->
  27. <Ellipse Margin="10" StrokeThickness="50">
  28. <interactivity:Interaction.Behaviors>
  29. <local:EllipseProgressBehavior
  30. x:Name="ellips"
  31. EndAngle="137"
  32. StartAngle="-137" />
  33. </interactivity:Interaction.Behaviors>
  34. <Ellipse.Stroke>
  35. <RadialGradientBrush>
  36. <GradientStop Color="#FF021534" />
  37. <GradientStop Offset="1" Color="#AA0578f1" />
  38. </RadialGradientBrush>
  39. </Ellipse.Stroke>
  40. </Ellipse>
  41. </Grid>
  42. <!-- 刻度 -->
  43. <Canvas
  44. Name="canvasPlate"
  45. Width="300"
  46. Height="300"
  47. Background="Transparent">
  48. <Canvas.RenderTransform>
  49. <RotateTransform Angle="-45" CenterX="150" CenterY="150" />
  50. </Canvas.RenderTransform>
  51. </Canvas>
  52. <!-- 指针 -->
  53. <Path
  54. Name="PATH"
  55. Data="M155,150 L150 290 L145 150 Z"
  56. Fill="#00c9ff"
  57. RenderTransformOrigin="0.968 0.518">
  58. <Path.RenderTransform>
  59. <RotateTransform x:Name="rtfPath" Angle="45" />
  60. </Path.RenderTransform>
  61. </Path>
  62. <!-- 中心圈 -->
  63. <Ellipse
  64. Canvas.Left="100"
  65. Canvas.Top="100"
  66. Width="100"
  67. Height="100"
  68. StrokeThickness="2">
  69. <Ellipse.Fill>
  70. <RadialGradientBrush>
  71. <GradientStop Color="#0b0d19" />
  72. <!--<GradientStop Offset="1" Color="#0b5b82" />-->
  73. <GradientStop Offset="1" Color="#AA0578f1" />
  74. <GradientStop Offset="0.5" Color="#0b0d19" />
  75. </RadialGradientBrush>
  76. </Ellipse.Fill>
  77. </Ellipse>
  78. <!-- 进度显示 -->
  79. <Grid
  80. Canvas.Left="100"
  81. Canvas.Top="100"
  82. Width="100"
  83. Height="100">
  84. <TextBlock
  85. HorizontalAlignment="Center"
  86. VerticalAlignment="Center"
  87. FontSize="25"
  88. Foreground="#DDD">
  89. <Run Text="{Binding Value, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" />
  90. <Run Text="{Binding Unit, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" />
  91. </TextBlock>
  92. </Grid>
  93. <Grid Canvas.Bottom="10" Width="300">
  94. <TextBlock
  95. HorizontalAlignment="Center"
  96. FontFamily="{Binding FontFamily, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
  97. FontSize="{Binding FontSize, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
  98. Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
  99. Text="{Binding Title, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" />
  100. </Grid>
  101. </Canvas>
  102. </Viewbox>
  103. </UserControl>