[Download the solution project]

There is a very weird issue in the current implementation of the Windows Phone 7 Panorama control. If you create an application that has the panorama control on its home page (and this is usually the case) you will notice that the initial sliding effect that exists in the Panorama control will not be played on the device. In the emulator everything seems to be running just fine. The other strange thing is that if you tombstone the application and the active it again the sliding effect of the panorama will be played.

Home Panorama

 

We had this problem in Telerik ToDo application and after a lot of debugging it seems that we found a way to worka round it. How we solved it?

We just extracted all the logic that is related to the panorama control and inserted it into a UserControl. Then this user control is added dynamically to the visual tree when the main page is loaded. Similar to this:

<!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" >
  
    </Grid>

 

void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            LayoutRoot.Children.Add(new PanoramaUserControl());
        }

 

Once we made this change the panorama started to slide as it should. Attached is the solution project for your reference. If you find/know a better solution to this problem I'll be glad to hear from you.

[Download the solution project]


About the Author

Valio Stoychev

Valentin Stoychev (@ValioStoychev) for long has been part of Telerik and worked on almost every UI suite that came out of Telerik. Valio now works as a Product Manager and strives to make every customer a successful customer.

 

Comments

Comments are disabled in preview mode.