OnOrientationEvent not fires

2 posts, 0 answers
  1. Thiago
    Thiago avatar
    16 posts
    Member since:
    May 2012

    Posted 15 Jun 2012 Link to this post

    Hi,
    I´ve added a transition control, how the sample provided on documentation, to switching between pages.
    But now, if I want use OnOrientationChanged event is not fired.
    Below is the code:

    private void InitializePhoneApplication()
            {
                if (phoneApplicationInitialized)
                    return;
     
                // Create the frame but don't set it as RootVisual yet; this allows the splash
                // screen to remain active until the application is ready to render.
                RadTransition transition = new RadTransition();
                transition.BackwardInAnimation = this.Resources["fadeInAnimation"] as RadFadeAnimation;
                transition.BackwardOutAnimation = this.Resources["fadeOutAnimation"] as RadFadeAnimation;
                transition.ForwardInAnimation = this.Resources["fadeInAnimation"] as RadFadeAnimation;
                transition.ForwardOutAnimation = this.Resources["fadeOutAnimation"] as RadFadeAnimation;
                transition.PlayMode = TransitionPlayMode.Consecutively;
     
                RadPhoneApplicationFrame frame = new RadPhoneApplicationFrame();
                frame.Transition = transition;
                RootFrame = frame;
                RootFrame.Navigated += CompleteInitializePhoneApplication;
                // Handle navigation failures
                RootFrame.NavigationFailed += RootFrame_NavigationFailed;
                // Ensure we don't initialize again
                phoneApplicationInitialized = true;
     
            }

    public partial class Gerador : PhoneApplicationPage
        {
            private GraficoViewModel ViewModel { get; set; }
     
            public Gerador()
            {
                ViewModel = new GraficoViewModel();
                DataContext = ViewModel;
     
                InitializeComponent();
     
                ViewModel.GeraGrafico(Utils.ALTURA_PORTRAIT, Utils.LARGURA_PORTRAIT, ref ContentPanel);
            }
     
            protected override void OnOrientationChanged(OrientationChangedEventArgs e)
            {
                base.OnOrientationChanged(e);
     
                //It´s not fired
            }
        }

    Is there anything wrong?
    Thanks in advance,
    Thiago
  2. Thiago
    Thiago avatar
    16 posts
    Member since:
    May 2012

    Posted 18 Jun 2012 Link to this post

    Hello,
    Problem solved!

    Best wishes,

    Thiago
  3. DevCraft banner
Back to Top