开发者

Apply Transition with Silverlight Toolkit to Grid containing Canvas in Windows Phone 7

Let me explain you the scenario

I am developing for Windows Phone 7 and have a page on which there is a button. At the buttons click event I have added the code to show the Canvas Panel that is present on the page

Canvas1.Visibility = System.Windows.Visibility.Visible;

This enables to pop up the Canvas instantly, now what I want is that this canvas should be visible with the turnstile transition effect provided in the silverlight toolkit for Windows Phone 7.

How d开发者_开发问答o I apply the transition on the Canvas only.


You need something like:

    TurnstileTransition turnstileTransition = new TurnstileTransition { Mode = TurnstileTransitionMode.BackwardIn};
    ITransition transition = turnstileTransition.GetTransition(Canvas1);
    transition.Completed += delegate
    {
        transition.Stop();
    };
    transition.Begin();

GetTransition(UIElement element) creates a new ITransition for the specified UIElement.

note:Handling of the Completed event is optional and it depends on the specified animation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜