|
- <UserControl
- x:Class="BPASmartClient.CustomResource.UserControls.TechnologyInstrument"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
- xmlns:interactivity="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:local="clr-namespace:BPASmartClient.CustomResource.UserControls"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- d:DesignHeight="300"
- d:DesignWidth="300"
- mc:Ignorable="d">
-
- <Viewbox>
- <Canvas Width="300" Height="300">
-
- <!-- 外边框和内边框进度 -->
- <Grid Width="300" Height="300">
- <!-- 外边框 -->
- <Ellipse Stroke="#0578f1" StrokeThickness="10">
- <interactivity:Interaction.Behaviors>
- <local:EllipseProgressBehavior
- EndAngle="137"
- Progress="100"
- StartAngle="-137" />
- </interactivity:Interaction.Behaviors>
- </Ellipse>
-
- <!-- 进度边框 -->
- <Ellipse Margin="10" StrokeThickness="50">
- <interactivity:Interaction.Behaviors>
- <local:EllipseProgressBehavior
- x:Name="ellips"
- EndAngle="137"
- StartAngle="-137" />
- </interactivity:Interaction.Behaviors>
- <Ellipse.Stroke>
- <RadialGradientBrush>
- <GradientStop Color="#FF021534" />
- <GradientStop Offset="1" Color="#AA0578f1" />
- </RadialGradientBrush>
- </Ellipse.Stroke>
- </Ellipse>
-
- </Grid>
-
- <!-- 刻度 -->
- <Canvas
- Name="canvasPlate"
- Width="300"
- Height="300"
- Background="Transparent">
- <Canvas.RenderTransform>
- <RotateTransform Angle="-45" CenterX="150" CenterY="150" />
- </Canvas.RenderTransform>
- </Canvas>
-
- <!-- 指针 -->
- <Path
- Name="PATH"
- Data="M155,150 L150 290 L145 150 Z"
- Fill="#00c9ff"
- RenderTransformOrigin="0.968 0.518">
- <Path.RenderTransform>
- <RotateTransform x:Name="rtfPath" Angle="45" />
- </Path.RenderTransform>
- </Path>
-
- <!-- 中心圈 -->
- <Ellipse
- Canvas.Left="100"
- Canvas.Top="100"
- Width="100"
- Height="100"
- StrokeThickness="2">
- <Ellipse.Fill>
- <RadialGradientBrush>
- <GradientStop Color="#0b0d19" />
- <!--<GradientStop Offset="1" Color="#0b5b82" />-->
- <GradientStop Offset="1" Color="#AA0578f1" />
- <GradientStop Offset="0.5" Color="#0b0d19" />
- </RadialGradientBrush>
- </Ellipse.Fill>
- </Ellipse>
-
- <!-- 进度显示 -->
- <Grid
- Canvas.Left="100"
- Canvas.Top="100"
- Width="100"
- Height="100">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="25"
- Foreground="#DDD">
- <Run Text="{Binding Value, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" />
- <Run Text="{Binding Unit, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" />
- </TextBlock>
- </Grid>
-
- <Grid Canvas.Bottom="10" Width="300">
- <TextBlock
- HorizontalAlignment="Center"
- FontFamily="{Binding FontFamily, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
- FontSize="{Binding FontSize, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
- Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
- Text="{Binding Title, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" />
- </Grid>
- </Canvas>
-
- </Viewbox>
-
- </UserControl>
|