This is a migrated thread and some comments may be shown as answers.

Page Orientation Changing

1 Answer 77 Views
PhoneApplicationFrame
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michael
Top achievements
Rank 1
Michael asked on 31 Aug 2011, 07:24 PM
Im trying to get an orientation changing animation working with your RadPhoneApplicationFrame class.  Previously I was using the code below that worked. Using the RadPhoneApplicationFrame as the root frame for the application makes this code not work.  Are there any modifications that can be made to regain the desired functionality?

Protected Friend Sub FacilityAddMod_OrientationChanged(sender As Object, e As Microsoft.Phone.Controls.OrientationChangedEventArgs) Handles MyBase.OrientationChanged
 
    Dim newOrientation As PageOrientation = e.Orientation
 
    FlipPage(DirectCast(DirectCast(Application.Current.RootVisual, PhoneApplicationFrame).Content, PhoneApplicationPage), newOrientation, lastOrientation)
 
    lastOrientation = newOrientation
End Sub
 
Public Sub FlipPage(page As PhoneApplicationPage, newOrientation As PageOrientation, lastOrientation As PageOrientation)
    Dim transitionElement As New RotateTransition
 
    Select Case newOrientation
        Case PageOrientation.Landscape, PageOrientation.LandscapeRight
            ' Come here from PortraitUp (i.e. clockwise) or LandscapeLeft?
            If lastOrientation = PageOrientation.PortraitUp Then
                transitionElement.Mode = RotateTransitionMode.In90Counterclockwise
            Else
                transitionElement.Mode = RotateTransitionMode.In180Clockwise
            End If
            Exit Select
        Case PageOrientation.LandscapeLeft
            ' Come here from LandscapeRight or PortraitUp?
            If lastOrientation = PageOrientation.LandscapeRight Then
                transitionElement.Mode = RotateTransitionMode.In180Counterclockwise
            Else
                transitionElement.Mode = RotateTransitionMode.In90Clockwise
            End If
            Exit Select
        Case PageOrientation.Portrait, PageOrientation.PortraitUp
            ' Come here from LandscapeLeft or LandscapeRight?
            If lastOrientation = PageOrientation.LandscapeLeft Then
                transitionElement.Mode = RotateTransitionMode.In90Counterclockwise
            Else
                transitionElement.Mode = RotateTransitionMode.In90Clockwise
            End If
            Exit Select
        Case Else
            Exit Select
    End Select
 
    ' Execute the transition
    Dim transition As ITransition = transitionElement.GetTransition(page)
 
    transition.Begin()
End Sub

 

 

 

 

 

 

 


1 Answer, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 02 Sep 2011, 11:34 AM
Hi Michael,

Thank you for contacting us.

We have recently found a bug in our RadPhoneApplicationFrame class related to OrientationChanged routine. We have a default animation that overrides the RenderTransform property of the frame, which on its hand breaks the default behavior of the base frame. You can workaround this problem by setting the animation to null:

RootFrame.OrientationChangeAnimation = null;

If this does not solve the problem I would kindly ask you to prepare a simple project that demonstrates the issue so that I may debug it and isolate the cause.

I am looking forward to your reply.

Regards,
Georgi
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
PhoneApplicationFrame
Asked by
Michael
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Share this question
or