<Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>        <ProgressBar Height="20" Width="200" Margin="0,4,0,0" Name="ProgressBar1" HorizontalAlignment="Center" VerticalAlignment="top" />    </Grid>在“System.Windows.Markup.StaticResourceHolder”上提供值时引发了异常。

解决方案 »

  1.   

    您能贴一下全部代码么?应该是其他地方的错误,不是ProgressBar本身的问题。
      

  2.   

    类代码如下:
    <Window x:Class="TestPresentor.TestSplash"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="TestSplash" Height="300" Width="300">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <ProgressBar Grid.Row="0" Grid.Column="0" Height="20" Width="200" Margin="0,4,0,0"   Name="ProgressBar1" HorizontalAlignment="Center"  VerticalAlignment="Center" />    </Grid>
    </Window>
      

  3.   

    跟项目应用的模板起冲突,定义一个Style进行应用即可。