Transitions and Effects when navigating to Views

Topics: Prism v4 - WPF 4
May 21, 2013 at 7:45 PM
Hi,

I need to navigate/show a View as a PopupWindow that slides in, from left to righ, and out in inverse direction of the Screen.

I have already found a WindowRegionAdapter here (http://blogs.southworks.net/ibaumann/2008/09/26/windowregionadapter-for-compositewpf-prism/) that works perfectly. How can I define a Transition/Effects to show this sliding.

Can I use the NavigateTo/NavigateFrom to implement the Effect ?
What is the best solution for this ?

Thanks in advance
May 22, 2013 at 5:38 PM
Hi,

In order to apply effect to your PopupWindow, you could subscribe to the Loaded and Closing events of your window in the code behind, and apply the corresponding effects on the handlers of these events.
public partial class MyPopupWindow : Window
{
    public MyPopupWindow()
    {
        this.Loaded += Shell_Loaded;
        this.Closing += Shell_Closing;
        InitializeComponent();
    }

    void Shell_Closing(object sender, System.ComponentModel.CancelEventArgs e)
    {
        //exit animation
    }

    void Shell_Loaded(object sender, RoutedEventArgs e)
    {
        //start animation
    }

}
Hope this helps,

Federico Martinez
http://blogs.southworks.net/fmartinez
May 23, 2013 at 6:28 PM
Thanks Frederico. I will try and let you know results.