質問

Using Visual state manager, How to change the Data for a Path. i have changed it by ObjectAnimationUsingKeyFrames in Silverlight but the same cant be used in WPF. Below i got an error that cant find the Target property "Data"..

Any Idea on this?

 <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>
役に立ちましたか?

解決

You would have to write it this way:

<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>
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top