我是XAML领域的新手,我只想了解VSM。当我在 StoryBoard 中添加一些东西时,总是会出现同样的错误。如下:
无法解析指定对象上的 TargetProperty Background.Color。
<phone:PhoneApplicationPage.Resources>
<ControlTemplate x:Key="ButtonControlTemplate1" TargetType="Button">
<Border
BorderThickness="{TemplateBinding BorderThickness}"
Height="{TemplateBinding Height}"
Width="{TemplateBinding Width}"
Margin="{TemplateBinding Margin}"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
Name="btnBorder">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<ColorAnimation Duration="0"
To="Blue"
Storyboard.TargetName="btnBorder"
Storyboard.TargetProperty="Background.Color"
/>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed"/>
<VisualState x:Name="Disabled"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" >
</ContentPresenter>
</Border>
</ControlTemplate>
</phone:PhoneApplicationPage.Resources>
<Button
x:Name="btnSubmit"
Grid.Row="3"
Grid.Column="0"
Grid.ColumnSpan="2"
Content="Login"
IsEnabled="False"
Click="btnSubmit_Click"
Margin="0"
BorderThickness="2"
BorderBrush="White"
Background="Aqua"
Padding="15"
Template="{StaticResource ButtonControlTemplate1}"
/>
为什么以及如何修复它,谢谢!