private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) { double ScreenWidth; double ScreenHeight; double AnchoContenido; // Switch the placement of the buttons based on an orientation change. if ((e.Orientation & PageOrientation.Portrait) == (PageOrientation.Portrait)) { ScreenWidth = Application.Current.Host.Content.ActualWidth; ScreenHeight = Application.Current.Host.Content.ActualHeight; AnchoContenido = ScreenWidth - 50; } // If not in portrait, move buttonList content to visible row and column. else { ScreenHeight = Application.Current.Host.Content.ActualWidth; ScreenWidth = Application.Current.Host.Content.ActualHeight; AnchoContenido = ScreenWidth - 147; } wbContenido.Width = AnchoContenido; stpContenido.Height = ScreenHeight - 20; stpContenido.Width = ScreenWidth - 20; }
protected override void OnOrientationChanged(OrientationChangedEventArgs e) { if (!(e.Orientation == PageOrientation.LandscapeRight)) { base.OnOrientationChanged(e); } }
protected override void OnOrientationChanged(OrientationChangedEventArgs e) { base.OnOrientationChanged(e); var orientation = e.Orientation; SetOrientation(orientation); }
protected override void OnOrientationChanged(OrientationChangedEventArgs e) { var RootGrid = this.FindName("LayoutRoot") as Grid; // var RotationGrid = RootGrid.FindName("ScreenFlow") as Grid; switch (e.Orientation) { case PageOrientation.Landscape: // ((Grid)this.FindName("LayoutRoot")).Margin = new Thickness(120, 0, 0, 0); break; case PageOrientation.LandscapeLeft: // RotationGrid.Margin = new Thickness(60, 0,70, 0); break; case PageOrientation.LandscapeRight: break; case PageOrientation.None: break; case PageOrientation.Portrait: break; case PageOrientation.PortraitDown: break; case PageOrientation.PortraitUp: break; default: break; } base.OnOrientationChanged(e); }
/// <summary> /// Animates the rectangle on orientation change /// </summary> /// <param name="e"></param> public void AnimateOrientationChange(OrientationChangedEventArgs e) { // check if new orientation is landscape or portrait if (e.Orientation == PageOrientation.Landscape || e.Orientation == PageOrientation.LandscapeLeft || e.Orientation == PageOrientation.LandscapeRight) { // if landscape dimensions were not calculated we must do it now if (!mAnimationInitialized) { // calculate landscape box size based on screen size mLandscapeWidth = ActualWidth * kLandscapeRatio; mLandscapeHeight = mLandscapeWidth * kAspectRatio; // set animation values for both animations (landcape to portrait and reverse) mP2LWidthAnimation.From = mPortraitHeight; mP2LWidthAnimation.To = mLandscapeWidth; mP2LHeightAnimation.From = mPortraitWidth; mP2LHeightAnimation.To = mLandscapeHeight; mL2PWidthAnimation.From = mLandscapeHeight; mL2PWidthAnimation.To = mPortraitWidth; mL2PHeightAnimation.From = mLandscapeWidth; mL2PHeightAnimation.To = mPortraitHeight; // mark animation as initialized and ready mAnimationInitialized = true; } // start portrait to landscape animation mP2LAnimation.Begin(); } else { // start landscape to portrait animation if all values are calculated if (mAnimationInitialized) { mL2PAnimation.Begin(); } } }
protected override void OnOrientationChanged(OrientationChangedEventArgs e) { base.OnOrientationChanged(e); switch (e.Orientation) { case PageOrientation.Landscape: break; case PageOrientation.LandscapeLeft: ContentPanel.Margin = new Thickness(0, 0, 75, 0); break; case PageOrientation.LandscapeRight: ContentPanel.Margin = new Thickness(75, 0, 0, 0); break; case PageOrientation.None: case PageOrientation.Portrait: case PageOrientation.PortraitDown: case PageOrientation.PortraitUp: default: ContentPanel.Margin = new Thickness(0, 0, 0, 0); break; } }
private void GamePageWP8_OrientationChanged(object sender, OrientationChangedEventArgs e) { if (this._game != null) { (this._game.Window as WindowsPhoneGameWindow).OrientationChanged += GamePage_OrientationChanged; } }
// Ensure that the viewfinder is upright in LandscapeRight. protected override void OnOrientationChanged(OrientationChangedEventArgs e) { if (camera != null) { // LandscapeRight rotation when camera is on back of phone int landscapeRightRotation = 180; // Change LandscapeRight rotation for front-facing camera if (camera.CameraType == CameraType.FrontFacing) landscapeRightRotation = -180; // Rotate video brush from camera if (e.Orientation == PageOrientation.PortraitUp) { // Rotate for LandscapeRight orientation mainCameraBrush.RelativeTransform = new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = landscapeRightRotation }; } else { // Rotate for standard landscape orientation mainCameraBrush.RelativeTransform = new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 0 }; } } base.OnOrientationChanged(e); }
protected override void OnOrientationChanged(OrientationChangedEventArgs e) { base.OnOrientationChanged(e); if (_previousOrientation == null) return; RotateTransition transitionElement = new RotateTransition(); // counter clockwise rotation if (_previousOrientation == PageOrientation.LandscapeRight && e.Orientation == PageOrientation.PortraitUp || _previousOrientation == PageOrientation.PortraitUp && e.Orientation == PageOrientation.LandscapeLeft || _previousOrientation == PageOrientation.LandscapeLeft && e.Orientation == PageOrientation.PortraitDown || _previousOrientation == PageOrientation.PortraitDown && e.Orientation == PageOrientation.LandscapeRight) transitionElement.Mode = RotateTransitionMode.In90Counterclockwise; // clockwise rotation else if (_previousOrientation == PageOrientation.LandscapeLeft && e.Orientation == PageOrientation.PortraitUp || _previousOrientation == PageOrientation.PortraitDown && e.Orientation == PageOrientation.LandscapeLeft || _previousOrientation == PageOrientation.LandscapeRight && e.Orientation == PageOrientation.PortraitDown || _previousOrientation == PageOrientation.PortraitUp && e.Orientation == PageOrientation.LandscapeRight) transitionElement.Mode = RotateTransitionMode.In90Clockwise; // 180 rotation else transitionElement.Mode = RotateTransitionMode.In180Clockwise; var transition = transitionElement.GetTransition((PhoneApplicationPage)(((PhoneApplicationFrame)Application.Current.RootVisual).Content)); transition.Completed += delegate { transition.Stop(); }; transition.Begin(); _previousOrientation = e.Orientation; }
public void OnOrientationChanged(OrientationChangedEventArgs e) { if (Camera != null) { Deployment.Current.Dispatcher.BeginInvoke(() => { // LandscapeRight rotation when camera is on back of device. int landscapeRightRotation = 180; // Change LandscapeRight rotation for front-facing camera. if (Camera.CameraType == CameraType.FrontFacing) landscapeRightRotation = -180; // Rotate video brush from camera. if (e.Orientation == PageOrientation.LandscapeRight) { // Rotate for LandscapeRight orientation. CurrentVideoBrush.RelativeTransform = new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = landscapeRightRotation }; } else { // Rotate for standard landscape orientation. CurrentVideoBrush.RelativeTransform = new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = 0 }; } }); } }
void MainPageOrientationChanged(object sender, OrientationChangedEventArgs e) { //var newOrientation = e.Orientation; //var transitionElement = new RotateTransition(); //switch (newOrientation) //{ // case PageOrientation.Landscape: // case PageOrientation.LandscapeRight: // transitionElement.Mode = _lastOrientation == PageOrientation.PortraitUp ? RotateTransitionMode.In90Counterclockwise : RotateTransitionMode.In180Clockwise; // break; // case PageOrientation.LandscapeLeft: // transitionElement.Mode = _lastOrientation == PageOrientation.LandscapeRight ? RotateTransitionMode.In180Counterclockwise : RotateTransitionMode.In90Clockwise; // break; // case PageOrientation.Portrait: // case PageOrientation.PortraitUp: // transitionElement.Mode = _lastOrientation == PageOrientation.LandscapeLeft ? RotateTransitionMode.In90Counterclockwise : RotateTransitionMode.In90Clockwise; // break; // default: // break; //} //var phoneApplicationPage = (PhoneApplicationPage)(((PhoneApplicationFrame)Application.Current.RootVisual)).Content; //var transition = transitionElement.GetTransition(phoneApplicationPage); //transition.Completed += delegate //{ // transition.Stop(); // UpdateOrientation(); //}; //transition.Begin(); //_lastOrientation = newOrientation; }
protected override void OnOrientationChanged(OrientationChangedEventArgs e) { if (e.Orientation == PageOrientation.PortraitDown || e.Orientation == PageOrientation.PortraitUp) { NavigationService.GoBack(); } base.OnOrientationChanged(e); }
protected override void OnOrientationChanged(OrientationChangedEventArgs e) { base.OnOrientationChanged(e); //vm.OnOrientationChanged(e); }
override protected void OnOrientationChanged(OrientationChangedEventArgs args) { base.OnOrientationChanged(args); if (m_d3dInterop != null) { DisplayOrientations orientation = ConvertToNativeOrientation(args.Orientation); m_d3dInterop.OnOrientationChanged(orientation); } }
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) { if (e.Orientation == PageOrientation.LandscapeLeft || e.Orientation == PageOrientation.LandscapeRight) { wrapPanelLayout.Width = (btnMap.Width * 3); } else wrapPanelLayout.Width = this.ActualWidth; }
protected override void OnOrientationChanged(OrientationChangedEventArgs e) { if ((e.Orientation & PageOrientation.Portrait) == PageOrientation.Portrait) { NavigationService.Navigate(new Uri("/View/Portrait/MapView.xaml", UriKind.Relative)); } base.OnOrientationChanged(e); }
/// <summary> /// Send orientation change message through MessagingCenter /// </summary> /// <param name="e">Orientation changed event args</param> public static void NotifyOrientationChange(OrientationChangedEventArgs e) { bool isLandscape = (e.Orientation & PageOrientation.Landscape) == PageOrientation.Landscape; var msg = new DeviceOrientationChangeMessage() { Orientation = isLandscape ? DeviceOrientations.Landscape : DeviceOrientations.Portrait }; MessagingCenter.Send<DeviceOrientationChangeMessage>(msg, DeviceOrientationChangeMessage.MessageId); }
void ResponsiveApp_OrientationChanged(object sender, OrientationChangedEventArgs e) { if (frame != null) { //intial call to setup default styles handleChangeEvents(new Size(frame.ActualWidth, frame.ActualHeight), frame.Orientation); } }
private void _frame_OrientationChanged(object sender, OrientationChangedEventArgs e) { if (_popup != null && _popup.Child is FrameworkElement && _frame != null) { var container = _popup.Child as FrameworkElement; container.Width = _frame.ActualWidth; container.Height = _frame.ActualHeight; } }
private void FrameOrientationChanged(object sender, OrientationChangedEventArgs e) { Deployment.Current.Dispatcher.BeginInvoke(() => { this.Orientation = e.Orientation; this.OnPropertyChanged("Orientation"); this.SetVisibilityProperties(e.Orientation); }); }
private void PageOrientationChanged(object sender, OrientationChangedEventArgs e) { if (e.Orientation == PageOrientation.LandscapeLeft || e.Orientation == PageOrientation.LandscapeRight) { var temp = ChapterTextContent.Height; ChapterTextContent.Height = ChapterTextContent.Width; ChapterTextContent.Width = temp; } }
// 用于生成本地化 ApplicationBar 的示例代码 //private void BuildLocalizedApplicationBar() //{ // // 将页面的 ApplicationBar 设置为 ApplicationBar 的新实例。 // ApplicationBar = new ApplicationBar(); // // 创建新按钮并将文本值设置为 AppResources 中的本地化字符串。 // ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/appbar.add.rest.png", UriKind.Relative)); // appBarButton.Text = AppResources.AppBarButtonText; // ApplicationBar.Buttons.Add(appBarButton); // // 使用 AppResources 中的本地化字符串创建新菜单项。 // ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText); // ApplicationBar.MenuItems.Add(appBarMenuItem); //} private void oriChange(object sender,OrientationChangedEventArgs e) { if(e.Orientation == PageOrientation.Landscape||e.Orientation == PageOrientation.LandscapeLeft||e.Orientation == PageOrientation.LandscapeRight) { this.checkPanel.Orientation = System.Windows.Controls.Orientation.Horizontal; } else{ this.checkPanel.Orientation = System.Windows.Controls.Orientation.Vertical; } }
private void MainWindow_Orientation_Changed(object sender, OrientationChangedEventArgs e) { if (wnd != null) { currentOrientationBlock.Text = wnd.lastOrientation.ToString().t(wnd.lang); if (wnd.lastOrientation == Orientation.Landscape) currentOrientationBlock.Foreground = Brushes.Green; else currentOrientationBlock.Foreground = Brushes.Red; } }
// Sample code for building a localized ApplicationBar //private void BuildLocalizedApplicationBar() //{ // // Set the page's ApplicationBar to a new instance of ApplicationBar. // ApplicationBar = new ApplicationBar(); // // Create a new button and set the text value to the localized string from AppResources. // ApplicationBarIconButton appBarButton = new ApplicationBarIconButton(new Uri("/Assets/AppBar/appbar.add.rest.png", UriKind.Relative)); // appBarButton.Text = AppResources.AppBarButtonText; // ApplicationBar.Buttons.Add(appBarButton); // // Create a new menu item with the localized string from AppResources. // ApplicationBarMenuItem appBarMenuItem = new ApplicationBarMenuItem(AppResources.AppBarMenuItemText); // ApplicationBar.MenuItems.Add(appBarMenuItem); //} private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) { if ((e.Orientation & PageOrientation.Landscape) == PageOrientation.Landscape) { VisualStateManager.GoToState(this, "Landscape", true); } else if ((e.Orientation & PageOrientation.Portrait) == PageOrientation.Portrait) { VisualStateManager.GoToState(this, "Portrait", true); } }
private void page_OrientationChanged(object sender, OrientationChangedEventArgs e) { int landscapeRotation = 0; if (e.Orientation == PageOrientation.LandscapeLeft) { LayoutRoot.Width = Application.Current.Host.Content.ActualHeight; LayoutRoot.Height = Application.Current.Host.Content.ActualWidth; viewFeed.Width = Application.Current.Host.Content.ActualHeight; viewFeed.Height = Application.Current.Host.Content.ActualWidth; // CompositeTransform.Rotation = _photoCamera.SensorRotationInDegrees - 90; landscapeRotation = 0; } else if (e.Orientation == PageOrientation.LandscapeRight) { LayoutRoot.Width = Application.Current.Host.Content.ActualHeight; LayoutRoot.Height = Application.Current.Host.Content.ActualWidth; viewFeed.Width = Application.Current.Host.Content.ActualHeight; viewFeed.Height = Application.Current.Host.Content.ActualWidth; //CompositeTransform.Rotation = PhotoCaptureDeviceProp.SensorRotationInDegrees + 90; landscapeRotation = 180; } else if (e.Orientation == PageOrientation.PortraitUp) { LayoutRoot.Height = Application.Current.Host.Content.ActualHeight; LayoutRoot.Width = Application.Current.Host.Content.ActualWidth; viewFeed.Height = Application.Current.Host.Content.ActualHeight; viewFeed.Width = Application.Current.Host.Content.ActualWidth; landscapeRotation = 90; //CompositeTransform.Rotation = PhotoCaptureDeviceProp.SensorRotationInDegrees; } else if (e.Orientation == PageOrientation.PortraitDown) { LayoutRoot.Height = Application.Current.Host.Content.ActualHeight; LayoutRoot.Width = Application.Current.Host.Content.ActualWidth; viewFeed.Height = Application.Current.Host.Content.ActualHeight; viewFeed.Width = Application.Current.Host.Content.ActualWidth; //CompositeTransform.Rotation = PhotoCaptureDeviceProp.SensorRotationInDegrees + 180; landscapeRotation = -90; } if (_photoCamera != null) { _videoBrush.RelativeTransform = new CompositeTransform() { CenterX = 0.5, CenterY = 0.5, Rotation = landscapeRotation }; _videoBrush.Stretch = Stretch.Fill; } }
/// <summary> /// Handles changes to the page's Orientation property. /// </summary> /// <param name="e">Event arguments.</param> protected override void OnOrientationChanged(OrientationChangedEventArgs e) { if (null == e) { throw new ArgumentNullException("e"); } base.OnOrientationChanged(e); SystemTrayPlaceholder.Visibility = (0 != (PageOrientation.Portrait & e.Orientation)) ? Visibility.Visible : Visibility.Collapsed; }
protected override void OnOrientationChanged( OrientationChangedEventArgs e ) { base.OnOrientationChanged( e ); if ( e.Orientation.HasFlag( PageOrientation.Portrait ) ) { VisualStateManager.GoToState( this, "Portrait", true ); } else if ( e.Orientation.HasFlag( PageOrientation.Landscape ) ) { VisualStateManager.GoToState( this, "Landscape", true ); } }
private void PhoneApplicationPage_OrientationChanged(object sender,OrientationChangedEventArgs e) { if (e.Orientation == PageOrientation.LandscapeLeft || e.Orientation == PageOrientation.LandscapeRight) { Title.Visibility = Visibility.Collapsed; } else { Title.Visibility = Visibility.Visible; } }
void ResponsivePage_OrientationChanged(object sender, OrientationChangedEventArgs e) { if (ResponsiveMethods != null) { foreach (var method in ResponsiveMethods) { method.HandleChange(new Size(this.ActualWidth, this.ActualHeight), base.Orientation, this.Resources.MergedDictionaries); } } }
protected override void OnOrientationChanged(OrientationChangedEventArgs e) { if (e.Orientation == PageOrientation.PortraitUp) { this.ApplicationBar.Mode = ApplicationBarMode.Minimized; } else { this.ApplicationBar.Mode = ApplicationBarMode.Default; } base.OnOrientationChanged(e); }
private void _parentPage_OrientationChanged(object sender, OrientationChangedEventArgs e) { this.UpdateAutoSuggestVisibility(); }
protected override void OnOrientationChanged(OrientationChangedEventArgs e) { base.OnOrientationChanged(e); SetListMargin(); }
void OnOrientationChanged(object sender, OrientationChangedEventArgs e) { MessagingCenter.Send(this, Forms.WP8DeviceInfo.BWPorientationChangedName, e.Orientation.ToDeviceOrientation()); }
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) { updateOrientation(e.Orientation); }
void MainPage_OrientationChanged(object sender, OrientationChangedEventArgs e) { RotateIamgeViewer(e.Orientation); }
void CurrentPageOrientationChanged(object sender, OrientationChangedEventArgs e) { ArrangePlacement(); }
private void Page_OrientationChanged(object sender, OrientationChangedEventArgs e) { this.Update(); }
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) { OrientationHelper.HideSystemTrayWhenInLandscapeMode(e.Orientation); }
private void RootFrame_OrientationChanged(object sender, OrientationChangedEventArgs e) { OrientationFixAngle = OrientationAngles.First(p => e.Orientation.HasFlag(p.Key)).Value; }
private void FrameOnOrientationChanged(object sender, OrientationChangedEventArgs orientationChangedEventArgs) { Root.Width = Screen.Width; Root.Height = Screen.Height; }
protected override void OnOrientationChanged(OrientationChangedEventArgs e) { base.OnOrientationChanged(e); ConfigureViewport(); }
private void CrossDeviceOrientation_Current_OrientationChanged(object sender, OrientationChangedEventArgs e) { labelView.Text = e.Orientation.ToString(); }
void page_OrientationChanged(object sender, OrientationChangedEventArgs e) { SetItemsControlSize(); }
protected override void OnOrientationChanged(OrientationChangedEventArgs e) { // 把下面的代码注释掉,页面的方向就会锁定 base.OnOrientationChanged(e); }
private void CurrentPage_OnOrientationChanged(object sender, OrientationChangedEventArgs e) { this.UpdateValuesForOrientation(); }
private void OnOrientationChanged(object sender, OrientationChangedEventArgs e) { ApplyOrientation(e.Orientation); }
protected override void OnOrientationChanged(OrientationChangedEventArgs e) { base.OnOrientationChanged(e); ApplyOrientation(e.Orientation); }
private void phoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) { if (e.Orientation == PageOrientation.LandscapeLeft || e.Orientation == PageOrientation.LandscapeRight) { ApplicationBar.IsVisible = false; TopRec.Width = 780; BottomRec.Width = 780; BottomRec.Margin = new Thickness(0, 0, 0, 0); cameraView.Margin = new Thickness(0, 20, 0, 20); cameraView.HorizontalAlignment = HorizontalAlignment.Left; cameraView.Height = 373; cameraView.Width = 456; rotation.CenterX = 0; rotation.CenterY = 0; if (e.Orientation == PageOrientation.LandscapeLeft) { rotation.Angle = 0; } else { rotation.Angle = 180; } cameraView.RenderTransform = rotation; Grid.SetColumnSpan(TargetDot, 1); Grid.SetColumnSpan(TargetDot2, 1); TargetDot.Margin = new Thickness(108, 0, 0, 0); TargetDot2.Margin = new Thickness(108, 0, 0, 0); Grid.SetRow(capture, 1); capture.HorizontalAlignment = HorizontalAlignment.Right; capture.VerticalAlignment = VerticalAlignment.Center; capture.Margin = new Thickness(0, 0, 40, 0); Grid.SetRow(camHeightInput, 1); Grid.SetRowSpan(camHeightInput, 1); camHeightInput.Margin = new Thickness(0, 10, 45, 0); camHeightInput.VerticalAlignment = VerticalAlignment.Top; Grid.SetRow(CamHeightLabel, 1); CamHeightLabel.HorizontalAlignment = HorizontalAlignment.Center; CamHeightLabel.Margin = new Thickness(-20, 30, 30, 0); Grid.SetRow(PitchOut, 1); Grid.SetColumn(PitchOut, 1); PitchOut.HorizontalAlignment = HorizontalAlignment.Center; PitchOut.VerticalAlignment = VerticalAlignment.Center; PitchOut.Margin = new Thickness(15, 0, 20, 0); Grid.SetRow(PitchLabel, 1); Grid.SetColumn(PitchLabel, 1); PitchLabel.VerticalAlignment = VerticalAlignment.Center; PitchLabel.Margin = new Thickness(115, 0, 20, 0); PitchLabel.Text = "Roll:"; Grid.SetRow(DistanceLabel, 1); Grid.SetColumn(DistanceLabel, 1); DistanceLabel.Margin = new Thickness(115, 0, 20, 125); Grid.SetRow(distanceOut, 1); Grid.SetColumn(distanceOut, 1); distanceOut.Margin = new Thickness(0, 0, 75, 124); Grid.SetRow(HeightLabel, 1); HeightLabel.Margin = new Thickness(115, 0, 20, 60); Grid.SetRow(heightOut, 1); heightOut.Margin = new Thickness(0, 0, 93, 60); if (!adFailed) { Ad.Visibility = Visibility.Visible; } } else { if (!checkForActiveProducts()) { ApplicationBar.IsVisible = true; } ApplicationBar.Opacity = .5; Thickness blankThickness = new Thickness(0, 0, 0, 0); TopRec.Width = 480; BottomRec.Width = 480; BottomRec.Margin = blankThickness; cameraView.Margin = blankThickness; cameraView.HorizontalAlignment = HorizontalAlignment.Center; cameraView.Width = 373; cameraView.Height = 456; rotation.Angle = 90; cameraView.RenderTransform = rotation; cameraView.Margin = blankThickness; Grid.SetColumnSpan(TargetDot, 2); Grid.SetColumnSpan(TargetDot2, 2); TargetDot.Margin = blankThickness; TargetDot2.Margin = blankThickness; Grid.SetRow(capture, 2); capture.HorizontalAlignment = HorizontalAlignment.Center; capture.VerticalAlignment = VerticalAlignment.Top; capture.Margin = blankThickness; Grid.SetRow(camHeightInput, 2); Grid.SetRowSpan(camHeightInput, 2); camHeightInput.Margin = new Thickness(0, 0, 10, 63); camHeightInput.VerticalAlignment = VerticalAlignment.Bottom; Grid.SetRow(CamHeightLabel, 3); CamHeightLabel.HorizontalAlignment = HorizontalAlignment.Left; CamHeightLabel.Margin = blankThickness; Grid.SetRow(PitchOut, 3); Grid.SetColumn(PitchOut, 0); PitchOut.HorizontalAlignment = HorizontalAlignment.Right; PitchOut.VerticalAlignment = VerticalAlignment.Top; PitchOut.Margin = new Thickness(0, 0, 100, 0); Grid.SetRow(PitchLabel, 3); Grid.SetColumn(PitchLabel, 0); PitchLabel.VerticalAlignment = VerticalAlignment.Top; PitchLabel.Margin = new Thickness(30, 0, 0, 0); PitchLabel.Text = "Pitch:"; Grid.SetRow(DistanceLabel, 3); Grid.SetColumn(DistanceLabel, 0); DistanceLabel.Margin = new Thickness(30, 83, 0, 0); Grid.SetRow(distanceOut, 3); Grid.SetColumn(distanceOut, 0); distanceOut.Margin = new Thickness(0, 0, 38, 0); Grid.SetRow(HeightLabel, 3); HeightLabel.Margin = blankThickness; Grid.SetRow(heightOut, 3); heightOut.Margin = new Thickness(0, 0, 102, 0); if (!adFailed) { Ad.Visibility = Visibility.Visible; } } }
private void HandleFrameOrientationChanged(object sender, OrientationChangedEventArgs e) { AdjustPopupChildForCurrentOrientation((PhoneApplicationFrame)sender); }
protected override void OnOrientationChanged(OrientationChangedEventArgs e) { this.native.OrientationChanged(e.Orientation.ToString()); base.OnOrientationChanged(e); }
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) { UnityApp.SetOrientation((int)e.Orientation); }
private void OrientationChanged(object sender, OrientationChangedEventArgs e) { // Handling orientation change is a heck more involved than I initially thought AssociatedObject.RenderTransform = new CompositeTransform(); }
//화면이 회전할때 페이지 사이즈 정보를 재설정한다. private void PhoneApplicationPage_OrientationChanged_1(object sender, OrientationChangedEventArgs e) { DeviceInfo.Load(); ResourceUri.Load(); }
void OnFrameOrientationChanged(object sender, OrientationChangedEventArgs e) { Restart(); }
/// <summary> /// Handles the OrientationChanged event. /// </summary> /// <param name="sender">Event source.</param> /// <param name="e">Event arguments.</param> private void HandleOrientationChanged(object sender, OrientationChangedEventArgs e) { // Stop/complete Storyboard in case it's active _storyboard.Stop(); HandleStoryboardCompleted(null, null); if (IsAnimationEnabled) { // Capture device width/height var actualWidth = ActualWidth; var actualHeight = ActualHeight; // Get "before" width/height bool normal = PageOrientation.Portrait == (PageOrientation.Portrait & _previousOrientation); var width = normal ? actualWidth : actualHeight; var height = normal ? actualHeight : actualWidth; // Capture "before" visuals in a WriteableBitmap var writeableBitmap = new WriteableBitmap((int)width, (int)height); writeableBitmap.Render(this, null); writeableBitmap.Invalidate(); // Create transforms for "before" content var beforeTranslateTransform = new TranslateTransform(); var beforeRotateTransform = new RotateTransform { CenterX = actualWidth / 2, CenterY = actualHeight / 2 }; var beforeTransforms = new TransformGroup(); beforeTransforms.Children.Add(beforeTranslateTransform); beforeTransforms.Children.Add(beforeRotateTransform); // Configure transforms for "before" content var translateDelta = (actualHeight - actualWidth) / 2; var beforeAngle = 0.0; if (PageOrientation.LandscapeLeft == _previousOrientation) { beforeAngle = -90; beforeTranslateTransform.X = -translateDelta; beforeTranslateTransform.Y = translateDelta; } else if (PageOrientation.LandscapeRight == _previousOrientation) { beforeAngle = 90; beforeTranslateTransform.X = -translateDelta; beforeTranslateTransform.Y = translateDelta; } beforeRotateTransform.Angle = -beforeAngle; // Configure for "after" content var afterAngle = 0.0; if (PageOrientation.LandscapeLeft == e.Orientation) { afterAngle = -90; } else if (PageOrientation.LandscapeRight == e.Orientation) { afterAngle = 90; } _afterRotateTransform.CenterX = actualWidth / 2; _afterRotateTransform.CenterY = actualHeight / 2; // Create content with default background and WriteableBitmap overlay for "before" var container = new Grid { Width = width, Height = height, Background = (Brush)Application.Current.Resources["PhoneBackgroundBrush"], RenderTransform = beforeTransforms, IsHitTestVisible = false, }; var content = new Rectangle { Fill = new ImageBrush { ImageSource = writeableBitmap, Stretch = Stretch.None, } }; container.Children.Add(content); // Configure Popup for displaying "before" content _popup.Child = container; _popup.IsOpen = true; // Update animations to fade from "before" to "after" Storyboard.SetTarget(_beforeOpacityAnimation, container); _beforeOpacityAnimation.Duration = Duration; _beforeOpacityAnimation.EasingFunction = EasingFunction; Storyboard.SetTarget(_afterOpacityAnimation, this); _afterOpacityAnimation.Duration = Duration; _afterOpacityAnimation.EasingFunction = EasingFunction; // Update animations to rotate from "before" to "after" Storyboard.SetTarget(_beforeRotationAnimation, beforeRotateTransform); _beforeRotationAnimation.From = beforeRotateTransform.Angle; _beforeRotationAnimation.To = _beforeRotationAnimation.From + (beforeAngle - afterAngle); _beforeRotationAnimation.Duration = Duration; _beforeRotationAnimation.EasingFunction = EasingFunction; Storyboard.SetTarget(_afterRotationAnimation, _afterRotateTransform); _afterRotationAnimation.From = -(beforeAngle - afterAngle); _afterRotationAnimation.To = 0; _afterRotationAnimation.Duration = Duration; _afterRotationAnimation.EasingFunction = EasingFunction; // Play the animations _storyboard.Begin(); } // Save current orientation for next time _previousOrientation = e.Orientation; }
private void onOrientationChange(object sender, OrientationChangedEventArgs e) { MessageBox.Show("You changed the Orientation to: " + this.Orientation, "Orientation Change", MessageBoxButton.OK); }
private void OnOrientationChanged(object sender, OrientationChangedEventArgs args) { BeginInvoke(new OnOrientationChangedDelegate(OnOrientationChangedMethod), args.Orientation); }
private void PhoneApplicationPage_OrientationChanged_1(object sender, OrientationChangedEventArgs e) { }
private void PageBase_OrientationChanged(object sender, OrientationChangedEventArgs e) { this.UpdateImageViewerDecoratorPosition(); this.OpenCloseMenu(false, null, false); }
private void PhoneApplicationPage_OrientationChanged(object sender, OrientationChangedEventArgs e) { // In landscape mode, the totals grid is moved to the right on the screen // which puts it in row 1, column 1. if ((e.Orientation & PageOrientation.Landscape) != 0) // landscape { MainPivot.Margin = new Thickness(20, 0, 0, 0); double topMargin2 = 0; double topMargin = topMargin2 + 50; tiles1.Visibility = System.Windows.Visibility.Collapsed; grid1.Margin = new Thickness(10, topMargin2, 0, 0); chart1.Margin = new Thickness(0, topMargin, 10, 0); tiles2.Visibility = System.Windows.Visibility.Collapsed; grid2.Margin = new Thickness(10, topMargin2, 0, 0); chart2.Margin = new Thickness(0, topMargin, 10, 0); tiles3.Visibility = System.Windows.Visibility.Collapsed; grid3.Margin = new Thickness(10, topMargin2, 0, 0); chart3.Margin = new Thickness(0, topMargin, 10, 0); tiles4.Visibility = System.Windows.Visibility.Collapsed; grid4.Margin = new Thickness(10, topMargin2, 0, 0); chart4.Margin = new Thickness(0, topMargin, 10, 0); tiles5.Visibility = System.Windows.Visibility.Collapsed; grid5.Margin = new Thickness(10, topMargin2, 0, 0); chart5.Margin = new Thickness(0, topMargin, 10, 0); tiles6.Visibility = System.Windows.Visibility.Collapsed; grid6.Margin = new Thickness(10, topMargin2, 0, 0); chart6.Margin = new Thickness(0, topMargin, 10, 0); tiles7.Visibility = System.Windows.Visibility.Collapsed; grid7.Margin = new Thickness(10, topMargin2, 0, 0); chart7.Margin = new Thickness(0, topMargin, 10, 0); tiles8.Visibility = System.Windows.Visibility.Collapsed; grid8.Margin = new Thickness(10, topMargin2, 0, 0); chart8.Margin = new Thickness(0, topMargin, 10, 0); } else // portrait { MainPivot.Margin = new Thickness(0, 0, 0, 0); double topMargin2 = 150; double topMargin = topMargin2 + 50; tiles1.Visibility = System.Windows.Visibility.Visible; grid1.Margin = new Thickness(10, topMargin2, 0, 0); chart1.Margin = new Thickness(0, topMargin, 10, 0); tiles2.Visibility = System.Windows.Visibility.Visible; grid2.Margin = new Thickness(10, topMargin2, 0, 0); chart2.Margin = new Thickness(0, topMargin, 10, 0); tiles3.Visibility = System.Windows.Visibility.Visible; grid3.Margin = new Thickness(10, topMargin2, 0, 0); chart3.Margin = new Thickness(0, topMargin, 10, 0); tiles4.Visibility = System.Windows.Visibility.Visible; grid4.Margin = new Thickness(10, topMargin2, 0, 0); chart4.Margin = new Thickness(0, topMargin, 10, 0); tiles5.Visibility = System.Windows.Visibility.Visible; grid5.Margin = new Thickness(10, topMargin2, 0, 0); chart5.Margin = new Thickness(0, topMargin, 10, 0); tiles6.Visibility = System.Windows.Visibility.Visible; grid6.Margin = new Thickness(10, topMargin2, 0, 0); chart6.Margin = new Thickness(0, topMargin, 10, 0); tiles7.Visibility = System.Windows.Visibility.Visible; grid7.Margin = new Thickness(10, topMargin2, 0, 0); chart7.Margin = new Thickness(0, topMargin, 10, 0); tiles8.Visibility = System.Windows.Visibility.Visible; grid8.Margin = new Thickness(10, topMargin2, 0, 0); chart8.Margin = new Thickness(0, topMargin, 10, 0); } }