Page Orientation Changing

Thread is closed for posting
2 posts, 0 answers
  1. Michael
    Michael avatar
    1 posts
    Member since:
    Aug 2011

    Posted 31 Aug 2011 Link to this post

    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
                    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
                    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
                    transitionElement.Mode = RotateTransitionMode.In90Clockwise
                End If
                Exit Select
            Case Else
                Exit Select
        End Select
        ' Execute the transition
        Dim transition As ITransition = transitionElement.GetTransition(page)
    End Sub








  2. Georgi
    Georgi avatar
    296 posts

    Posted 02 Sep 2011 Link to this post

    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.

    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 >>

Back to Top