如何在WPF中更改路径的数据?

如何在WPF中更改路径的数据?,wpf,silverlight,path,visualstatemanager,Wpf,Silverlight,Path,Visualstatemanager,使用Visual state manager,了解如何更改路径的数据。我在Silverlight中使用关键帧通过ObjectAnimationUsingKeyFrames对其进行了更改,但在WPF中不能使用相同的方法。下面我得到一个错误,无法找到目标属性“数据” 有什么想法吗 <Storyboard BeginTime="0"> <ObjectAnimationUsingKeyFrames BeginTime="0"

使用Visual state manager,了解如何更改路径的数据。我在Silverlight中使用关键帧通过ObjectAnimationUsingKeyFrames对其进行了更改,但在WPF中不能使用相同的方法。下面我得到一个错误,无法找到目标属性“数据”

有什么想法吗

 <Storyboard BeginTime="0">
     <ObjectAnimationUsingKeyFrames BeginTime="0"
                                    Duration="1"
                                    Storyboard.TargetName="path"
                                    Storyboard.TargetProperty="Data">
           <DiscreteObjectKeyFrame KeyTime="0" Value="M2.1299944,9.9798575L55.945994,9.9798575 35.197562,34.081179 35.197562,62.672859 23.428433,55.942383 23.428433,33.52121z M1.3001332,0L56.635813,0C57.355887,0,57.935946,0.5891428,57.935946,1.3080959L57.935946,2.8258877C57.935946,3.5448422,57.355887,4.133985,56.635813,4.133985L1.3001332,4.133985C0.58005941,4.133985,-2.3841858E-07,3.5448422,0,2.8258877L0,1.3080959C-2.3841858E-07,0.5891428,0.58005941,0,1.3001332,0z" />
      </ObjectAnimationUsingKeyFrames>
 </Storyboard>

您必须这样写:

<ObjectAnimationUsingKeyFrames Storyboard.TargetName="path"
                               Storyboard.TargetProperty="Data">
    <DiscreteObjectKeyFrame KeyTime="0">
        <DiscreteObjectKeyFrame.Value>
            <Geometry>M2.1299944,9.9798575L55.945994,9.9798575 35.197562,34.081179 35.197562,62.672859 23.428433,55.942383 23.428433,33.52121z M1.3001332,0L56.635813,0C57.355887,0,57.935946,0.5891428,57.935946,1.3080959L57.935946,2.8258877C57.935946,3.5448422,57.355887,4.133985,56.635813,4.133985L1.3001332,4.133985C0.58005941,4.133985,-2.3841858E-07,3.5448422,0,2.8258877L0,1.3080959C-2.3841858E-07,0.5891428,0.58005941,0,1.3001332,0z</Geometry>
        </DiscreteObjectKeyFrame.Value>
    </DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>

9.97979757575 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 7 7 7 9 9 9 9 9 9 9 9 7 7 7 7 7 7 7 7 7 7 9 9 9 9 9 9 7 7 7 7 7 7 7 7 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 7 7 7 7 5 5 5 5 5 5 5 5 5 5 5 5 9 9 9 9 9 9 7 7 7 7 7 7 7 7 7 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 7 7 7 7 7 7 7 7 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9,-2.3841858E-07,3.5448422,0,2.8258877L0,1.3080959C-2.3841858E-07,0.5891428,0.58005941,0,1.3001332,0z

问题被指向错误的方向。在使用此代码时,我遇到了一个错误,比如找不到属性“Data”。如何解决此问题?
path
必须是的实例。是。。path是path类型的实例的名称。那个么到底什么不起作用呢?你需要再解释一下。