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

OnOrientationEvent not fires

1 Answer 36 Views
TransitionControl
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Thiago
Top achievements
Rank 1
Thiago asked on 15 Jun 2012, 02:26 PM
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

1 Answer, 1 is accepted

Sort by
0
Thiago
Top achievements
Rank 1
answered on 18 Jun 2012, 11:51 AM
Hello,
Problem solved!

Best wishes,

Thiago
Tags
TransitionControl
Asked by
Thiago
Top achievements
Rank 1
Answers by
Thiago
Top achievements
Rank 1
Share this question
or