How to ignore all user interaction until a specific EntranceThemeTransition finishes? (c#)

Proposed Answer How to ignore all user interaction until a specific EntranceThemeTransition finishes? (c#)

  • 2012年5月5日 19:27
     
     

    I have a popup that enters screen with animation, but user may want to speed up the process and click wildly to the popup, that may dismiss the popup (which i don't want).

    1) Can i disable FULL user interaction with the application?

    2) Can i detect the end of the EntranceThemeTransition?

全部回复

  • 2012年5月7日 14:53
    版主
     
     建议的答复

    I think you need to look into these properties:

    IsDoubleTapEnabled

    Read/write Gets or sets a value that determines whether the DoubleTapped event can originate from that element. (Inherited from UIElement)

    IsHoldingEnabled

    Read/write Gets or sets a value that determines whether the Holding event can originate from that element. (Inherited from UIElement)

    IsRightTapEnabled

    Read/write Gets or sets a value that determines whether the RightTapped  event can originate from that element. (Inherited from UIElement)

    IsTapEnabled

    Read/write Gets or sets a value that determines whether the Tapped  event can originate from that element. (Inherited from UIElement)

    If you want to do this like a blanket you can add a grid or something else that covers all of your elements and set these values to false, and put the grid inside of a canvas so you can set the z-index of the grid to a higher value than the rest of your application.

    I don't see any events that fire when the EntranceThemeTransition ends, but you might try experimenting with the Loaded event of your controls.


    Matt Small - Microsoft Escalation Engineer - Forum Moderator If my reply answers your question, please mark this post as answered.

  • 2012年5月7日 21:40
     
     

    Thank you for your reply.

    I think i understood the first part of your message.

    I tried the second part: Playing with the controls' and also particular element's "Loaded" events.

    They are called immediately. I also tried LayoutUpdated to check the animated value (this.GetValue(Canvas.LeftProperty)) but it's already set to the final value right at the beginning-first call. So if i can't detect the end of the animation i can not re-enable everything as i don't want to put a timer by guessing the EntranceThemeTransition 's duration. It may be changed in the future and i'll either re-enable everything before the animation finishes or far after it's end. 

  • 2012年10月8日 10:03
     
     

    Hi,

    did you find a method to detect if the application has running/active animations?

    I'm touching the same problem in that user interaction should be disabled while element are (animated) added to a container.
    The reason is that the user is able to pickup a element and move it over the page. This cause conflicts in that it also updates elements that are still being animated onto the screen.

    Greetings and thanks in advance,


    Peter Vrenken - MCPD: Enterprise Applications Developer - Atos