private void Current_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
 {
     _currentHeight = e.Size.Height;
     _currentWidth = e.Size.Width;
     _currentOrientation = ApplicationView.GetForCurrentView().Orientation;
     UpdateTrigger();
 }
Exemple #2
0
        private void OnWindowSizeChanged(object sender, WindowSizeChangedEventArgs e)
        {
            var applicationView = ApplicationView.GetForCurrentView();

            Orientation = applicationView.Orientation;

            UpdatePopupSize();
            UpdateVisualState(useTransitions: true);
        }
Exemple #3
0
        private async void Current_SizeChanged(object sender, WindowSizeChangedEventArgs e)
        {
            var currentView = ApplicationView.GetForCurrentView();

            if (this.currentViewOrientation != currentView.Orientation)
            {
                this.currentViewOrientation = currentView.Orientation;
                await this.Navigate(this.ContentDataContext?.GetType(), null, XamlNav.NavigationMode.New, NavigationType.Code);
            }

            this.ContentDataContext?.As <ISizeAware>()?.SizeChanged(e.Size.Width, e.Size.Height);
        }
Exemple #4
0
        /// <summary>
        /// Initializes a new instance of <see cref="NavigationFrame"/>
        /// </summary>
        public NavigationFrame()
        {
            this.VerticalContentAlignment   = VerticalAlignment.Stretch;
            this.HorizontalContentAlignment = HorizontalAlignment.Stretch;

            this.BackStack    = new List <PageStackEntry>();
            this.ForwardStack = new List <PageStackEntry>();
            this.Unloaded    += NavigationFrame_Unloaded;

            Window.Current.Activated         += Current_Activated;
            Window.Current.SizeChanged       += Current_SizeChanged;
            Window.Current.Closed            += Current_Closed;
            Window.Current.VisibilityChanged += Current_VisibilityChanged;

            SystemNavigationManager.GetForCurrentView().BackRequested += NavigationFrame_BackRequested;
            ApplicationView.GetForCurrentView().VisibleBoundsChanged  += NavigationFrame_VisibleBoundsChanged;

            this.currentViewOrientation = ApplicationView.GetForCurrentView().Orientation;
        }
Exemple #5
0
        public InCall()
        {
            this.InitializeComponent();
            this.DataContext = new InCallModel();
            askingVideo      = false;

            if (LinphoneManager.Instance.IsVideoAvailable)
            {
                StartVideoStream();
                VideoGrid.Visibility = Visibility.Collapsed;
            }

            if (LinphoneManager.Instance.Core.CurrentCall.State == CallState.StreamsRunning)
            {
                Status.Text = "00:00:00";
            }

            displayOrientation = ApplicationView.GetForCurrentView().Orientation;
            displayInformation = DisplayInformation.GetForCurrentView();
            deviceOrientation  = SimpleOrientation.NotRotated;
            orientationSensor  = SimpleOrientationSensor.GetDefault();
            if (orientationSensor != null)
            {
                deviceOrientation = orientationSensor.GetCurrentOrientation();
                SetVideoOrientation();
                orientationSensor.OrientationChanged += OrientationSensor_OrientationChanged;
            }

            buttons.HangUpClick    += buttons_HangUpClick;
            buttons.StatsClick     += buttons_StatsClick;
            buttons.CameraClick    += buttons_CameraClick;
            buttons.PauseClick     += buttons_PauseClick;
            buttons.SpeakerClick   += buttons_SpeakerClick;
            buttons.MuteClick      += buttons_MuteClick;
            buttons.VideoClick     += buttons_VideoClick;
            buttons.BluetoothClick += buttons_BluetoothClick;
            buttons.DialpadClick   += buttons_DialpadClick;

            // Handling event when app will be suspended
            Application.Current.Suspending += new SuspendingEventHandler(App_Suspended);
            Application.Current.Resuming   += new EventHandler <object>(App_Resumed);
            pausedCall = null;
        }
        /// <summary>
        /// Updates the layout when the window size changes
        /// </summary>
        private void InvalidateLayout()
        {
            // Get window orientation
            ApplicationViewOrientation winOrientation = ApplicationView.GetForCurrentView().Orientation;

            if (winOrientation == ApplicationViewOrientation.Landscape)
            {
                // Update grid to stack the boxes horizontally in landscape orientation
                Grid.SetColumn(Box1, 0);
                Grid.SetRow(Box1, 0);
                Grid.SetColumnSpan(Box1, 1);
                Grid.SetRowSpan(Box1, 2);

                Grid.SetColumn(Box2, 1);
                Grid.SetRow(Box2, 0);
                Grid.SetColumnSpan(Box2, 1);
                Grid.SetRowSpan(Box2, 2);

                rootPage.NotifyUser("Windows orientation is landscape.", NotifyType.StatusMessage);
            }
            else if (winOrientation == ApplicationViewOrientation.Portrait)
            {
                // Update grid to stack the boxes vertically in portrait orientation
                Grid.SetColumn(Box1, 0);
                Grid.SetRow(Box1, 0);
                Grid.SetColumnSpan(Box1, 2);
                Grid.SetRowSpan(Box1, 1);

                Grid.SetColumn(Box2, 0);
                Grid.SetRow(Box2, 1);
                Grid.SetColumnSpan(Box2, 2);
                Grid.SetRowSpan(Box2, 1);

                rootPage.NotifyUser("Windows orientation is portrait.", NotifyType.StatusMessage);
            }
        }
		private void OnAppView_VisibleBoundsChanged(ApplicationView sender, object args)
		{
			if (Visibility == Visibility.Visible && _appView.Orientation != _prevOrientation)
			{
				_prevOrientation = _appView.Orientation;
				InvalidateMeasure();
			}
		}
		public LolloChart()
		{
			InitializeComponent();
			_appView = ApplicationView.GetForCurrentView();
			_prevOrientation = _appView.Orientation;

			//DataContext = this;
			SetLineStyles();
			// LOLLO NOTE the buttons respond at once, the manipulations instead are slow. Their speed improves if I only set a couple.
			// I need to catch TranslateY so I can compare X e Y and do nothing is Abs(Y) > Abs(X)
			GridChartArea.ManipulationMode = ManipulationModes.Scale | ManipulationModes.TranslateX | ManipulationModes.TranslateY;
		}
        private void OnWindowSizeChanged(object sender, WindowSizeChangedEventArgs e)
        {
            var applicationView = ApplicationView.GetForCurrentView();

            Orientation = applicationView.Orientation;

            UpdatePopupSize();
            UpdateVisualState(useTransitions: true);
        }
        public Orientation GetOrientation()
        {
            ApplicationViewOrientation orientation = ApplicationView.GetForCurrentView().Orientation;

            return(orientation == ApplicationViewOrientation.Landscape ? Orientation.Landscape : Orientation.Portrait);
        }
Exemple #11
0
 public OrientationChangedEventArgsHelper(ApplicationViewOrientation orientation)
 {
     this.Orientation = orientation;
 }
		public LolloChart()
		{
			InitializeComponent();
			_appView = ApplicationView.GetForCurrentView();
			_prevOrientation = _appView.Orientation;

			//DataContext = this;
			SetLineStyles();
		}
 public OrientationChangedEventArgsHelper(ApplicationViewOrientation orientation)
     {
         this.Orientation = orientation;
     }