Xaml &引用;无法解析TargetName边框";错误wp8

Xaml &引用;无法解析TargetName边框";错误wp8,xaml,exception,animation,windows-phone-8,Xaml,Exception,Animation,Windows Phone 8,嗨,当用户按下页面上的任何按钮时,我创建了一个动画。使用下面的代码。它只是在按下按钮时使用旋转动画,并在按下按钮时禁用按钮的标准蓝色背景色 但是我得到了一个异常“无法解析TargetName边界”!请参见//这应该很明显--没有名为“Border”的元素。你是想写“纽扣背景”吗?@McGarnagle谢谢,很明显@McGarnagle我已经用“ButtonBackground”替换了“Border”,但是现在当按下按钮时,我有了默认的彩色背景!?我做错了什么-救命,谢谢 <

嗨,当用户按下页面上的任何按钮时,我创建了一个动画。使用下面的代码。它只是在按下按钮时使用旋转动画,并在按下按钮时禁用按钮的标准蓝色背景色


但是我得到了一个异常“无法解析TargetName边界”!请参见//这应该很明显--没有名为“Border”的元素。你是想写“纽扣背景”吗?@McGarnagle谢谢,很明显@McGarnagle我已经用“ButtonBackground”替换了“Border”,但是现在当按下按钮时,我有了默认的彩色背景!?我做错了什么-救命,谢谢
        <ControlTemplate x:Key="ButtonBaseControlTemplate1" TargetType="ButtonBase">
        <Grid Background="Transparent">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal"/>
                    <VisualState x:Name="MouseOver"/>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Border">//<<<<-----THIS
                                <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent"/>
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentContainer" Storyboard.TargetProperty="Foreground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneButtonBasePressedForegroundBrush}" />
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneAccentBrush}" />
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentContainer" Storyboard.TargetProperty="Foreground">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="BorderBrush">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PhoneDisabledBrush}" />
                            </ObjectAnimationUsingKeyFrames>
                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonBackground" Storyboard.TargetProperty="Background">
                                <DiscreteObjectKeyFrame KeyTime="0" Value="Transparent" />
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Border x:Name="ButtonBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="0" Background="{TemplateBinding Background}" Margin="{StaticResource PhoneTouchTargetOverhang}" >
                <ContentControl x:Name="ContentContainer" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Padding="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
            </Border>
        </Grid>
    </ControlTemplate>