Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wpf 垂直进度条_Wpf_Xaml_Progress Bar - Fatal编程技术网

Wpf 垂直进度条

Wpf 垂直进度条,wpf,xaml,progress-bar,Wpf,Xaml,Progress Bar,我试图在WPF中实现一个垂直进度条,但遇到了一些困难。我一直在关注格雷格·D的答案,但这对我不起作用。我尝试过使用外部样式和内联样式,但没有成功。这很烦人,因为这似乎是一个相对简单的答案 这是我的XAML 我得到的错误是在线上的,我得到 在类型“System.Windows.Controls.Control”上找不到模板属性“Orientation” 设置ControlTemplate的TargetType。设置ControlTemplate的TargetType 或 或 <Progres

我试图在WPF中实现一个垂直进度条,但遇到了一些困难。我一直在关注格雷格·D的答案,但这对我不起作用。我尝试过使用外部样式和内联样式,但没有成功。这很烦人,因为这似乎是一个相对简单的答案

这是我的XAML

我得到的错误是在线上的,我得到

在类型“System.Windows.Controls.Control”上找不到模板属性“Orientation”

设置ControlTemplate的TargetType。

设置ControlTemplate的TargetType

<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">