Inheritance: IWindowSizeChangedEventArgs, ICoreWindowEventArgs
示例#1
0
 void OnSizeChanged(object sender, 
   WindowSizeChangedEventArgs e)
 {
   base.SetActive(
     ((this.AspectRatio == AspectRatio.Landscape) && (e.Size.Width > e.Size.Height)) ||
     ((this.AspectRatio == AspectRatio.Portrait) && (e.Size.Width <= e.Size.Height)));
 }
示例#2
0
 private void Window_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
 {
     if (e.Size.Width > 920 && Frame.BackStackDepth > 0)
     {
         Frame.GoBack();
     }
 }
        private void OnWindowSizeChanged(object sender, WindowSizeChangedEventArgs e)
        {
            var size = e.Size;

            var stateName = size.Width <= 500 ? "NarrowState" : "WideState";

            VisualStateManager.GoToState(this, stateName, true);
        }
 void ExtendedSplash_OnResize(Object sender, WindowSizeChangedEventArgs e) {
     if (splash != null) {
         splashImageRect = splash.ImageLocation;
         PositionImage();
         //PositionRing();
         PositionLoginButton();
     }
 }
 void ExtendedSplash_OnResize(Object sender, WindowSizeChangedEventArgs e) {
     // Safely update the extended splash screen image coordinates. This function will be fired in response to snapping, unsnapping, rotation, etc...
     if (this.SP != null) {
         // Update the coordinates of the splash screen image.
         this.splashImageRect = this.SP.ImageLocation;
         this.PositionImage();
     }
 }
示例#6
0
        private void Window_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
        {
            if (ShouldGoToWideState())
            {
                Window.Current.SizeChanged -= Window_SizeChanged;

                NavigateBackForWideState(useTransition: false);
            }
        }
示例#7
0
        void Current_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
        {
            // Get the new view state
            // Add: using Windows.UI.ViewManagement;
            string CurrentViewState = ApplicationView.GetForCurrentView().Orientation.ToString();

            // Trigger the Visual State Manager
            VisualStateManager.GoToState(this, CurrentViewState, true);
        }
示例#8
0
文件: Window.cs 项目: jokm1/uno-2
        private void RaiseSizeChanged(Windows.UI.Core.WindowSizeChangedEventArgs windowSizeChangedEventArgs)
        {
            SizeChanged?.Invoke(this, windowSizeChangedEventArgs);
            CoreWindow.GetForCurrentThread()?.OnSizeChanged(windowSizeChangedEventArgs);

            foreach (var action in _sizeChangedHandlers)
            {
                action(this, windowSizeChangedEventArgs);
            }
        }
        private void ExtendedSplash_OnResize(object sender, WindowSizeChangedEventArgs e)
        {
            // Safely update the extended _splash screen image coordinates. This function will be fired in response to snapping, unsnapping, rotation, etc...
            if (_splash == null) return;

            // Update the coordinates of the _splash screen image.
            SplashImageRect = _splash.ImageLocation;
            PositionImage();
            PositionRing();
        }
 // Safely update the extended splash screen image coordinates. This function will be executed when a user resizes the window.
 private void ExtendedSplash_OnResize(Object sender, WindowSizeChangedEventArgs e)
 {
     if (splash != null)
     {
         // Update the coordinates of the splash screen image.
         splashImageRect = splash.ImageLocation;
         PositionImage();
         PositionRing();
     }
 }
 private void CurrentWindowOnSizeChanged(object sender, WindowSizeChangedEventArgs windowSizeChangedEventArgs)
 {
     if (windowSizeChangedEventArgs.Size.Width <= 992)
     {
         isOpened = false;
     }
     else
     {
         isOpened = true;
     }
 }
示例#12
0
 private void ExtendedSplash_OnResize(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
 {
     // Safely update the extended splash screen image coordinates. This function will be fired in response to snapping, unsnapping, rotation, etc...
     if (splash != null)
     {
         // Update the coordinates of the splash screen image.
         splashImageRect = splash.ImageLocation;
         PositionImage();
         PositionRing();
     }
 }
示例#13
0
 void WindowSizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
 {
     if (e.Size.Width <= 750)
     {
         VisualStateManager.GoToState(this, "ColumnarLayout", false);
     }
     else
     {
         VisualStateManager.GoToState(this, "TabularLayout", false);
     }
 }
示例#14
0
 private void CurrentOnSizeChanged(object sender, WindowSizeChangedEventArgs windowSizeChangedEventArgs)
 {
     if (windowSizeChangedEventArgs.Size.Width < 1050)
     {
         VisualStateManager.GoToState(this, Loc.Main.Topics.Any() ? "SnapTopicView" : "SnapTopicList", false);
     }
     else
     {
         VisualStateManager.GoToState(this, "FullTwoColumns", false);
     }
 }
        private void CoreWindow_SizeChanged(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.WindowSizeChangedEventArgs args)
        {
            var appView = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView();

            if (!appView.IsFullScreen)
            {
                appView.TryEnterFullScreenMode();
                //appView.TryEnterViewModeAsync();
            }
            args.Handled = true;
        }
示例#16
0
        private void Window_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
        {
            if (ShouldGoToWideState())
            {
                // Make sure we are no longer listening to window change events.
                Window.Current.SizeChanged -= Window_SizeChanged;

                // We shouldn't see this page since we are in "wide master-detail" mode.
                NavigateBackForWideState(useTransition: false);
            }
        }
 private async void SizeChanged(object sender, WindowSizeChangedEventArgs e)
 {
     await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         if (UIViewSettings.GetForCurrentView().UserInteractionMode == Windows.UI.ViewManagement.UserInteractionMode.Mouse)
         {
             SetActive(this.IsInMouseMode);
         }
         else
         {
             SetActive(!this.IsInMouseMode);
         }
     });
 }
示例#18
0
        public void Current_SizeChanged(object sender, WindowSizeChangedEventArgs e)
        {
            var page = sender as Page;
            if (page == null)
                throw new Exception("sender is not a page");

            var o = ApplicationView.GetForCurrentView().Orientation;

            var stateName = o.Equals(ApplicationViewOrientation.Landscape) 
                ? LandscapeStateName 
                : PortraitStateName;

            VisualStateManager.GoToState(page, stateName, true);
        }
 public static void WindowSizeChanged(object sender, WindowSizeChangedEventArgs args)
 {
     ApplicationViewState viewState = ApplicationView.Value;
     if (viewState == ApplicationViewState.Snapped)
     {
         Window.Current.Content = App.SnappedViewFrame;
     }
     else
     {
         if (Window.Current.Content != App.MainWindowFrame)
         {
             Window.Current.Content = App.MainWindowFrame;
         }
     }
     Window.Current.Activate();
 }
示例#20
0
        //----------------------------------------------------------------------
        // PRIVATE EVENT HANDLERS
        //----------------------------------------------------------------------

        //----------------------------------------------------------------------
        private void HandleWindowResized( object sender, WindowSizeChangedEventArgs e )
        {
            if( ApplicationView.GetForCurrentView().IsFullScreenMode && mMediaElement.IsFullScreen ||
                !ApplicationView.GetForCurrentView().IsFullScreenMode && !mMediaElement.IsFullScreen )
            {
                // do nothing
            }
            else if( ApplicationView.GetForCurrentView().IsFullScreenMode && !mMediaElement.IsFullScreen )
            {
                mMediaElement.IsFullScreen = true;
            }
            else if( !ApplicationView.GetForCurrentView().IsFullScreenMode && mMediaElement.IsFullScreen )
            {
                mMediaElement.IsFullScreen = false;
            }
        }
示例#21
0
        //Tailor the user experience of your app to be touch-first for tablet mode or mouse-first for Desktop usage.
        private void OnWindowSizeChanged(object sender, WindowSizeChangedEventArgs e)
        {
            switch (UIViewSettings.GetForCurrentView().UserInteractionMode)
            {
                // desktop
                case UserInteractionMode.Mouse:
                    VisualStateManager.GoToState(this, "MediumState", true);
                    break;

                // tablet
                case UserInteractionMode.Touch:
                default:
                    VisualStateManager.GoToState(this, "WideState", true);
                    break;
            }
        }
示例#22
0
        private void Current_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
        {
            object wantedItem = GridPage.FindName(ellipseName);

            if (wantedItem is Ellipse)
            {
                Ellipse ellipse   = wantedItem as Ellipse;
                double  newHeight = Window.Current.Bounds.Height;
                if (Window.Current.Bounds.Width < Window.Current.Bounds.Height)
                {
                    newHeight = Window.Current.Bounds.Width;
                }
                ellipse.Height = (newHeight / 2) - 10;
                ellipse.Width  = ellipse.Height;
            }
        }
示例#23
0
        //called when the window is resized
        static void _window_SizeChanged(CoreWindow sender, WindowSizeChangedEventArgs args)
        {
            if (args.Size.Width == _windowsBounds.Width)
            {
                _windowState = WindowState.Full;
            }
            else if (args.Size.Width <= 320.00)
            {
                _windowState = WindowState.Snap1Quarter;
            }
            else
            {
                _windowState = WindowState.Snap3Quarter;
            }

            _windowsBounds.Height = args.Size.Height;
            _windowsBounds.Width = args.Size.Width;
        }
        private void CurrentOnSizeChanged(object sender, WindowSizeChangedEventArgs e)
        {
            var viewState = ApplicationView.Value;
            NormalView.Dispose();
            NormalView.SetupGame();
            SnappedView.Dispose();
            SnappedView.SetupGame();

            if (viewState == ApplicationViewState.Snapped)
            {
                NormalView.Visibility = Visibility.Collapsed;
                SnappedView.Visibility = Visibility.Visible;
            }
            else
            {
                NormalView.Visibility = Visibility.Visible;
                SnappedView.Visibility = Visibility.Collapsed;

            }
        }
示例#25
0
        private void UpdateStatusBar(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
        {
            var color = Color.FromArgb(127, 0x65, 0x8c, 0xdd);
            var phone = ("Windows.Mobile" == AnalyticsInfo.VersionInfo.DeviceFamily);

            if (phone)
            {
                if (Window.Current.Bounds.Width > Window.Current.Bounds.Height)
                {
                    SetStatusBarColor(Colors.Black);
                }
                else
                {
                    SetStatusBarColor(color);
                }
            }
            else
            {
                SetStatusBarColor(color);
            }
        }
 private void OnSizeChanged(object sender, WindowSizeChangedEventArgs e)
 {
     Element?.ForceLayout();
 }
示例#27
0
 void window_SizeChanged(CoreWindow sender, WindowSizeChangedEventArgs args)
 {
     windowSize = new Size2F((float)args.Size.Width, (float)args.Size.Height);
     args.Handled = true;
 }
示例#28
0
 private static void OnWindowSizeChanged(object sender, WindowSizeChangedEventArgs windowSizeChangedEventArgs)
 {
     UpdateOrientationAwareControls(GetOrientationAwareControls(), ApplicationView.Value);
 }
 private void WindowSizeChanged(object sender, WindowSizeChangedEventArgs e)
 {
     this.InvalidateVisualState();
 }
示例#30
0
 private void WindowSizeChanged(object sender, WindowSizeChangedEventArgs e)
 {
     SetSize();
 }
示例#31
0
 private void OnsizeChanged(object sender, WindowSizeChangedEventArgs e)
 {
     double AppWidth = e.Size.Width;
     double AppHeight = e.Size.Height;
     if (AppWidth <= windowsRect.Width / 2)
     {
         gView.Visibility = Visibility.Collapsed;
         lView.Visibility = Visibility.Visible;
     }
     else
     {
         gView.Visibility = Visibility.Visible;
         lView.Visibility = Visibility.Collapsed;
     }
 }
 void MainPage_SizeChanged(Object sender, Windows.UI.Core.WindowSizeChangedEventArgs args)
 {
     CheckResolutionAndViewState();
 }
示例#33
0
 private void CurrentWindow_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
 {
     RefreshrLayout();
 }
示例#34
0
 void WindowSizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
 {
     // We don't use layout aware page's view states, we have our own
     UpdateViewState();
 }
示例#35
0
 private void OnWindowSizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
 {
     IsDropDownOpen = false;
 }
示例#36
0
 /// <summary>
 /// Event handler for window size changes.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void OnWindowSizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
 {
     UpdatePositionAndVisibility();
 }
示例#37
0
 private void WindowSizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
 {
     dimensions = e.Size;
     MarkedUp.AnalyticClient.SessionEvent("Window size changed");
 }
示例#38
0
 private void OnWindowSizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
 {
 }
示例#39
0
 private void OnCurrentWindowSizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e) =>
 UpdateState();
示例#40
0
 /// <summary>
 /// Respond to window resizing
 /// </summary>
 private void OnResize(WindowSizeChangedEventArgs args = null)
 {
     if (splash != null)
     {
         // extended splash is still visible, game not loaded
         splashImageRect = splash.ImageLocation;
         ExtendedSplashImage.SetValue(Canvas.LeftProperty, splashImageRect.X);
         ExtendedSplashImage.SetValue(Canvas.TopProperty, splashImageRect.Y);
         ExtendedSplashImage.Height = splashImageRect.Height;
         ExtendedSplashImage.Width = splashImageRect.Width;
     }
 }
示例#41
0
 void OnWindowSizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs args)
 {
     UpdateMode();
 }
示例#42
0
 public static void OnWindowSizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
 {
     _windowBounds = Window.Current.Bounds;
 }
示例#43
0
 private void Current_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
 {
     SetSize(e.Size.Width);
 }
示例#44
0
 private void CoreWindow_SizeChanged(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.WindowSizeChangedEventArgs args)
 {
     //(args.Size.Width + "x" + args.Size.Height).PrintDebug();
 }
示例#45
0
 private void Current_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
 {
     UpdateSize(e.Size);
     AnimateSections();
 }
 void OnWindowSizeChanged(object sender, WindowSizeChangedEventArgs e)
 {
     UpdateFullScreenModeStatus();
 }
示例#47
0
 private void Current_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
 {
     UpdateSize();
 }
示例#48
0
 private void ApplicationViewSizing_SizeChanged(CoreWindow sender, Windows.UI.Core.WindowSizeChangedEventArgs args)
 {
     LastSizeTime.Text = DateTime.Now.ToLongTimeString();
     LastSize.Text     = args.Size.Width + "x" + args.Size.Height;
 }
示例#49
0
 private void OnWindowSizeChanged(CoreWindow window, WindowSizeChangedEventArgs args)
 {
     //throw new NotImplementedException();
 }
示例#50
0
 private void Window_SizeChanged(object sender, WindowSizeChangedEventArgs e)
 {
     // System.Diagnostics.Debug.WriteLine(string.Format("Size Changed {0}", this.GetHashCode()));
     CalculateState();
 }
 void Current_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
 {
     ChangeVisualState(e.Size.Width);
 }
 private void Current_SizeChanged(object sender, WindowSizeChangedEventArgs e)
 {
     EvaluateLayout();
 }
示例#53
0
 /// <summary>
 /// Invoked with the Window changes size
 /// </summary>
 /// <param name="sender">The current Window</param>
 /// <param name="e">Event data that describes the new size of the Window</param>
 private void Window_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
 {
     this.InvalidateVisualState();
 }
示例#54
0
 /// <summary>
 /// Fired when the window size changes.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Windows_SizeChanged(object sender, WindowSizeChangedEventArgs e)
 {
     OnScreenSizeChanged((int)e.Size.Width);
 }
 private void WindowSizeChanged(object sender, WindowSizeChangedEventArgs e)
 {
     if (ApplicationView.Value == ApplicationViewState.Snapped &&
         !CanOpenInSnappedView)
     {
         this.IsOpen = false;
     }
 } 
示例#56
0
 private void Current_SizeChanged(object sender, WindowSizeChangedEventArgs e)
 {
     Calculate();
 }
        private void Current_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
        {
            var visibleScreen = GetScreenBounds();

            ResizeInlineFrameDialog(visibleScreen.Height, visibleScreen.Width);
        }
示例#58
0
 private void Current_SizeChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
 => InvalidateMeasure();
 private void OnWindowSizeChanged(WindowSizeChangedEventArgs args)
 {
     if (_popup.IsOpen && _popup.Child != null && _settings != null)
         UpdatePopup(args.Size.Width, args.Size.Height);
 }