Wpf 垂直进度条
我试图在WPF中实现一个垂直进度条,但遇到了一些困难。我一直在关注格雷格·D的答案,但这对我不起作用。我尝试过使用外部样式和内联样式,但没有成功。这很烦人,因为这似乎是一个相对简单的答案 这是我的XAML 我得到的错误是在线上的,我得到 在类型“System.Windows.Controls.Control”上找不到模板属性“Orientation” 设置ControlTemplate的TargetType。设置ControlTemplate的TargetType 或 或Wpf 垂直进度条,wpf,xaml,progress-bar,Wpf,Xaml,Progress Bar,我试图在WPF中实现一个垂直进度条,但遇到了一些困难。我一直在关注格雷格·D的答案,但这对我不起作用。我尝试过使用外部样式和内联样式,但没有成功。这很烦人,因为这似乎是一个相对简单的答案 这是我的XAML 我得到的错误是在线上的,我得到 在类型“System.Windows.Controls.Control”上找不到模板属性“Orientation” 设置ControlTemplate的TargetType。设置ControlTemplate的TargetType 或 或 <Progres
<ProgressBar Name="VolumeMeter" Orientation="Vertical" Margin="4,30,0,0"
Value="50" HorizontalAlignment="Left" VerticalAlignment="Top" Height="300" Width="10">
<ProgressBar.Template>
<ControlTemplate>
<Border BorderBrush="Green" x:Name="Root" BorderThickness="1">
<Grid Name="PART_Track" Background="Red">
<Rectangle Name="PART_Indicator" Fill="Blue"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Orientation" Value="Vertical">//Error Here
<!-- Rotate the progressbar so the left edge is the bottom edge -->
<Setter TargetName="Root" Property="LayoutTransform">
<Setter.Value>
<RotateTransform Angle="270" />
</Setter.Value>
</Setter>
<Setter TargetName="Root" Property="Width"
Value="{Binding RelativeSource={RelativeSource TemplatedParent},
Path=Height}"/>
<Setter TargetName="Root" Property="Height"
Value="{Binding RelativeSource={RelativeSource TemplatedParent},
Path=Width}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ProgressBar.Template>
</ProgressBar>
<ControlTemplate TargetType="ProgressBar">
<Trigger Property="ProgressBar.Orientation" Value="Vertical">