|
- <UserControl
- x:Class="BPASmartClient.CustomResource.UserControls.Instrument"
- 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:local="clr-namespace:BPASmartClient.CustomResource.UserControls"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- d:DesignHeight="450"
- d:DesignWidth="800"
- mc:Ignorable="d">
- <Grid>
- <Ellipse x:Name="backEllipse" Fill="{Binding PlateBackground, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" />
- <!-- 画布 -->
- <Canvas
- x:Name="mainCanvas"
- Width="{Binding Width, ElementName=backEllipse}"
- Height="{Binding Height, ElementName=backEllipse}" />
-
- <!-- 圆弧 -->
- <Path
- Name="Circle"
- Width="{Binding Width, ElementName=backEllipse}"
- Height="{Binding Height, ElementName=backEllipse}"
- Data=""
- RenderTransformOrigin="0.5 0.5"
- Stroke="White"
- StrokeEndLineCap="Round"
- StrokeStartLineCap="Round"
- StrokeThickness="4">
- <Path.RenderTransform>
- <RotateTransform Angle="-45" />
- </Path.RenderTransform>
- </Path>
-
- <!-- 指针 -->
- <Path
- Name="pointer"
- Width="{Binding Width, ElementName=backEllipse}"
- Height="{Binding Height, ElementName=backEllipse}"
- Data=""
- Fill="{Binding PointerColor, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
- RenderTransformOrigin="0.5 0.5">
- <Path.RenderTransform>
- <RotateTransform x:Name="rtPointer" Angle="-45" />
- </Path.RenderTransform>
- </Path>
-
- <!-- 圆心 -->
- <Border
- Width="30"
- Height="30"
- CornerRadius="15">
- <Border.Background>
- <RadialGradientBrush>
- <GradientStop Offset="0.583" Color="White" />
- <GradientStop Offset="1" Color="#ff97b5bd" />
- </RadialGradientBrush>
- </Border.Background>
- </Border>
-
- <!-- 显示文本和单位 -->
- <StackPanel
- Margin="0,0,0,40"
- HorizontalAlignment="Center"
- VerticalAlignment="Bottom"
- Orientation="Horizontal">
- <TextBlock
- Background="Transparent"
- FontSize="{Binding ScaleTextSize, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
- Foreground="{Binding ScaleBrush, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
- Text="{Binding Value, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" />
- <TextBlock
- Margin="5,0,0,0"
- Background="Transparent"
- FontSize="{Binding ScaleTextSize, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
- Foreground="{Binding ScaleBrush, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}"
- Text="{Binding Unit, RelativeSource={RelativeSource AncestorType=UserControl, Mode=FindAncestor}}" />
- </StackPanel>
-
- </Grid>
- </UserControl>
|