|
- <ResourceDictionary
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls"
- xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing">
- <Style TargetType="{x:Type control:Dashboard}">
- <Setter Property="Value" Value="0" />
- <Setter Property="Maximum" Value="120" />
- <Setter Property="Minimum" Value="0" />
- <Setter Property="PlateBackground" Value="Transparent" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type control:Dashboard}">
- <Grid>
- <Viewbox>
- <Border
- Background="{TemplateBinding PlateBackground}"
- BorderBrush="{TemplateBinding PlateBorderBrush}"
- BorderThickness="{TemplateBinding PlateBorderThickness}"
- ClipToBounds="True"
- CornerRadius="200">
- <Grid>
- <Canvas
- Name="canvasPlate"
- Width="400"
- Height="400"
- Margin="14"
- Background="Transparent">
- <Canvas.RenderTransform>
- <RotateTransform Angle="-45" CenterX="200" CenterY="200" />
- </Canvas.RenderTransform>
- </Canvas>
- <ed:Arc
- ArcThickness="24"
- ArcThicknessUnit="Pixel"
- EndAngle="135.5"
- Fill="#45246B"
- Opacity="0.1"
- StartAngle="-135.5"
- Stretch="None"
- StrokeEndLineCap="Round"
- StrokeStartLineCap="Round" />
- <ed:Arc
- x:Name="arckd"
- ArcThickness="24"
- ArcThicknessUnit="Pixel"
- EndAngle="50"
- Fill="#2E1C5C"
- Opacity="0.8"
- StartAngle="-135.5"
- Stretch="None"
- StrokeEndLineCap="Round"
- StrokeStartLineCap="Round" />
- <!-- 刻度盘当前值对应的圆弧 -->
-
- <Border
- Width="240"
- Height="240"
- Margin="14"
- CornerRadius="120"
- Opacity="0.5">
- <Border.Background>
- <RadialGradientBrush RadiusX="1" RadiusY="1">
- <GradientStop Offset="0.2" Color="#45246B" />
- <GradientStop Offset="0.3" Color="#2E1C5C" />
- <GradientStop Offset="0.5" Color="#253192" />
- </RadialGradientBrush>
- </Border.Background>
- </Border>
- <Path
- Name="pointer"
- Margin="14"
- Data="M200 205,40 200,200 195,200 205"
- RenderTransformOrigin="0.5,0.5">
- <Path.Fill>
- <RadialGradientBrush RadiusX="1" RadiusY="1">
- <GradientStop Offset="0.3" Color="#00C9FF" />
- <GradientStop Offset="0.4" Color="#CE97EF" />
- <GradientStop Offset="1" Color="#091851" />
- </RadialGradientBrush>
- </Path.Fill>
- <Path.RenderTransform>
- <RotateTransform x:Name="rtPointer" Angle="-45" />
- </Path.RenderTransform>
- </Path>
- <Border
- Width="80"
- Height="80"
- Margin="14"
- CornerRadius="40">
- <Border.Background>
- <RadialGradientBrush RadiusX="1" RadiusY="1">
- <GradientStop Offset="0.2" Color="#45246B" />
- <GradientStop Offset="0.3" Color="#2E1C5C" />
- <GradientStop Offset="0.5" Color="#253192" />
- </RadialGradientBrush>
- </Border.Background>
- <StackPanel
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Orientation="Vertical">
- <TextBlock
- x:Name="valueTxt"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="30" />
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="12"
- Text="km/h" />
- </StackPanel>
- </Border>
- </Grid>
- </Border>
- </Viewbox>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|