locked
VisualStateManager, DiscreteObjectKeyFrame.KeyTime and Default transitions

    Question

  • I am trying to figure out how to play ObjectAnimationUsingKeyFrames at the beginning of the transition.

    Let's say I have a default state and other state.

    In other state VIsualState I have something like (Blend 2013 generated):

    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="border">
    							<DiscreteObjectKeyFrame KeyTime="0">
    								<DiscreteObjectKeyFrame.Value>
    									<Visibility>Visible</Visibility>
    								</DiscreteObjectKeyFrame.Value>
    							</DiscreteObjectKeyFrame>
    						</ObjectAnimationUsingKeyFrames>
    Note the KeyTime="0".

    And I have set the Default transition to 1s.

    I'd expect Visiblity to change immediately, but that isn't the case. Instead it is changed only at the end of transition (after 1s). If I set a higher KeyTime then it is played that much time *after* transition ended.

    So, the question is whether is possible to play that at the beginning of the transition using Default transitions.


    Miha Markic [MVP C#] http://blog.rthand.com

    Thursday, March 19, 2015 1:23 PM

All replies

  • Hi Miha,

    I'm not sure if it is possible with XAML but always possible with code, for example when the animation finished, we can have the Completed event fire and we can execute the transition.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, March 20, 2015 6:01 AM
    Moderator