當前位置: 首頁>>代碼示例>>C#>>正文


C# Core.WindowSizeChangedEventArgs類代碼示例

本文整理匯總了C#中Windows.UI.Core.WindowSizeChangedEventArgs的典型用法代碼示例。如果您正苦於以下問題:C# WindowSizeChangedEventArgs類的具體用法?C# WindowSizeChangedEventArgs怎麽用?C# WindowSizeChangedEventArgs使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


WindowSizeChangedEventArgs類屬於Windows.UI.Core命名空間,在下文中一共展示了WindowSizeChangedEventArgs類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnSizeChanged

 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)));
 }
開發者ID:xesf,項目名稱:UWPSpheroDemo,代碼行數:7,代碼來源:PortraitTrigger.cs

示例2: ExtendedSplash_OnResize

 void ExtendedSplash_OnResize(Object sender, WindowSizeChangedEventArgs e) {
     if (splash != null) {
         splashImageRect = splash.ImageLocation;
         PositionImage();
         //PositionRing();
         PositionLoginButton();
     }
 }
開發者ID:cychow,項目名稱:GroupmeAnalytics,代碼行數:8,代碼來源:ExtendedSplash.xaml.cs

示例3: OnWindowSizeChanged

        private void OnWindowSizeChanged(object sender, WindowSizeChangedEventArgs e)
        {
            var size = e.Size;

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

            VisualStateManager.GoToState(this, stateName, true);
        }
開發者ID:krisgithub123,項目名稱:windows-10-demos,代碼行數:8,代碼來源:ReleaseDetailsView.xaml.cs

示例4: ExtendedSplash_OnResize

 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();
     }
 }
開發者ID:zhangcj,項目名稱:Xamarin.Forms.Lagou,代碼行數:8,代碼來源:Splash.xaml.cs

示例5: ExtendedSplash_OnResize

 // 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();
     }
 }
開發者ID:danielbeckmann,項目名稱:DotNETJumpStart,代碼行數:11,代碼來源:SplashPage.xaml.cs

示例6: ExtendedSplash_OnResize

        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();
        }
開發者ID:davidvidmar,項目名稱:MobilnaPoraba,代碼行數:10,代碼來源:ExtendedSplash.xaml.cs

示例7: CurrentOnSizeChanged

 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);
     }
 }
開發者ID:FLKone,項目名稱:HFR4WinRT,代碼行數:11,代碼來源:MainPage.xaml.cs

示例8: CurrentWindowOnSizeChanged

 private void CurrentWindowOnSizeChanged(object sender, WindowSizeChangedEventArgs windowSizeChangedEventArgs)
 {
     if (windowSizeChangedEventArgs.Size.Width <= 992)
     {
         isOpened = false;
     }
     else
     {
         isOpened = true;
     }
 }
開發者ID:garolard,項目名稱:GeekyBlogs,代碼行數:11,代碼來源:AdaptiveSuggestBox.xaml.cs

示例9: SizeChanged

 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);
         }
     });
 }
開發者ID:ArunSuryaPrakash,項目名稱:UserInteractionMode,代碼行數:14,代碼來源:UserInteractionTrigger.cs

示例10: Current_SizeChanged

        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);
        }
開發者ID:phmatray,項目名稱:CCrossHelper,代碼行數:14,代碼來源:OrientationHelper.cs

示例11: WindowSizeChanged

 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();
 }
開發者ID:theWindSweptDev,項目名稱:adamant-guacamole,代碼行數:16,代碼來源:App.xaml.cs

示例12: OnWindowSizeChanged

        //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;
            }
        }
開發者ID:tinwy,項目名稱:TinDoesWork,代碼行數:17,代碼來源:MainPage.xaml.cs

示例13: HandleWindowResized

        //----------------------------------------------------------------------
        // 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;
            }
        }
開發者ID:alanebro82,項目名稱:Twitch,代碼行數:21,代碼來源:PlayerPage.xaml.cs

示例14: _window_SizeChanged

        //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;
        }
開發者ID:SeanDunford,項目名稱:misc-windows-apps,代碼行數:19,代碼來源:GameState.cs

示例15: CurrentOnSizeChanged

        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;

            }
        }
開發者ID:MartenOlofsson,項目名稱:KnowYourCeleb,代碼行數:20,代碼來源:MainPage.xaml.cs


注:本文中的Windows.UI.Core.WindowSizeChangedEventArgs類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。