当前位置: 首页>>代码示例>>C#>>正文


C# DisplayInformation类代码示例

本文整理汇总了C#中DisplayInformation的典型用法代码示例。如果您正苦于以下问题:C# DisplayInformation类的具体用法?C# DisplayInformation怎么用?C# DisplayInformation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DisplayInformation类属于命名空间,在下文中一共展示了DisplayInformation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: displayInformation_OrientationChanged

 /// <summary>
 /// Invoked when there is a change in the display orientation.
 /// </summary>
 /// <param name="sender">
 /// DisplayInformation object from which the new Orientation can be determined
 /// </param>
 /// <param name="e"></param>
 void displayInformation_OrientationChanged(DisplayInformation sender, object args)
 {
     if (null != accelerometerReadingTransform)
     {
         accelerometerReadingTransform.ReadingTransform = sender.CurrentOrientation;
     }
 }
开发者ID:AJ-COOL,项目名称:Windows-universal-samples,代码行数:14,代码来源:Scenario4_OrientationChanged.xaml.cs

示例2: WindowsDeviceInfo

		public WindowsDeviceInfo()
		{
			// TODO: Screen size and DPI can change at any time
			_information = DisplayInformation.GetForCurrentView();
			_information.OrientationChanged += OnOrientationChanged;
			CurrentOrientation = GetDeviceOrientation(_information.CurrentOrientation);
		}
开发者ID:Costo,项目名称:Xamarin.Forms,代码行数:7,代码来源:WindowsDeviceInfo.cs

示例3: OnDisplayContentsInvalidated

 private void OnDisplayContentsInvalidated(DisplayInformation sender, object args)
 {
     Debug.WriteLine("CompositionImageLoader - Display Contents Invalidated");
     //
     // This will trigger the device lost event
     //
     CanvasDevice.GetSharedDevice();
 }
开发者ID:clarkezone,项目名称:composition,代码行数:8,代码来源:ImageLoader.cs

示例4: DisplayInformation_OrientationChanged

 private void DisplayInformation_OrientationChanged(DisplayInformation sender, Object args)
 {
     displayOrientation = sender.CurrentOrientation;
     if (capturing)
     {
         setPreviewRotation();
     }
 }
开发者ID:amoldeshpande,项目名称:slartoolkit,代码行数:8,代码来源:MainPage.xaml.cs

示例5: UpdateDpi

 private void UpdateDpi(DisplayInformation displayInformation)
 {
     if (displayInformation != null)
     {
         LogicalDpi = displayInformation.LogicalDpi.ToString();
         Scale = (displayInformation.RawPixelsPerViewPixel * 100.0).ToString();
     }
 }
开发者ID:dimkname,项目名称:UAP-Samples,代码行数:8,代码来源:MainViewModel.cs

示例6: DisplayInformation_OrientationChanged

        private void DisplayInformation_OrientationChanged(DisplayInformation sender, object args)
        {
            var strategy = GetHighlightStrategyForOrientation(DisplayInformation.GetForCurrentView().CurrentOrientation);

            if (_viewModel.ChangeHighlightStrategyCommand.CanExecute(strategy))
            {
                _viewModel.ChangeHighlightStrategyCommand.Execute(strategy);
            }
        }
开发者ID:roachhd,项目名称:filter-explorer,代码行数:9,代码来源:StreamPage.xaml.cs

示例7: MainPage_OrientationChanged

 private async void MainPage_OrientationChanged(DisplayInformation sender, object args) {
     if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar")) {
         var flag = sender.CurrentOrientation != DisplayOrientations.Portrait;
         StatusBar statusBar = StatusBar.GetForCurrentView();
         if (flag)
             await statusBar.HideAsync();
         else
             await statusBar.ShowAsync();
     }
 }
开发者ID:zhangcj,项目名称:Xamarin.Forms.Lagou,代码行数:10,代码来源:MainPage.xaml.cs

示例8: OrientationChanged

 private void OrientationChanged(DisplayInformation sender, object args)
 {
     if (sender.CurrentOrientation == DisplayOrientations.Landscape || sender.CurrentOrientation == DisplayOrientations.LandscapeFlipped)
     {
         ShellViewModel.SetHamburguerButtonProperties(Visibility.Collapsed);
     }
     else
     {
         ShellViewModel.SetHamburguerButtonProperties(Visibility.Visible);
     }
 }
开发者ID:ridomin,项目名称:DJNanoSampleApp,代码行数:11,代码来源:BaseDetailLayout.cs

示例9: DisplayInfo_OrientationChanged

 private void DisplayInfo_OrientationChanged(DisplayInformation sender, object args)
 {
     if (mediaCapture != null)
     {
         mediaCapture.SetPreviewRotation(frontCam
         ? VideoRotationLookup(sender.CurrentOrientation, true)
         : VideoRotationLookup(sender.CurrentOrientation, false));
         var rotation = VideoRotationLookup(sender.CurrentOrientation, false);
         mediaCapture.SetRecordRotation(rotation);
     }
 }
开发者ID:GoreMaria,项目名称:LondonHack2,代码行数:11,代码来源:MainPage.xaml.cs

示例10: OnOrientationChanged

 private void OnOrientationChanged(DisplayInformation sender, object args)
 {
     if (sender.CurrentOrientation == DisplayOrientations.Portrait)
     {
         this.SetDisplayForWidth(this.currentViewHeight);
     }
     else
     {
         this.SetDisplayForWidth(this.currentViewWidth);
     }
     
 }
开发者ID:JayceeQ,项目名称:codeshow,代码行数:12,代码来源:CodeShowControl.xaml.cs

示例11: DisplayInfoOrientationChanged

        private void DisplayInfoOrientationChanged(DisplayInformation sender, object args)
        {
            var orientation = sender.CurrentOrientation;
            if (orientation == DisplayOrientations.Landscape || orientation == DisplayOrientations.LandscapeFlipped)
            {
                var res = VisualStateManager.GoToState(this, "Landscape", true);

            }
            if (orientation == DisplayOrientations.Portrait || orientation == DisplayOrientations.PortraitFlipped)
            {
                var res = VisualStateManager.GoToState(this, "Portrait", false);
            }
        }
开发者ID:Khoubaib1,项目名称:MyProducts,代码行数:13,代码来源:Page_Details.xaml.cs

示例12: Scenario4_OrientationChanged

        public Scenario4_OrientationChanged()
        {
            this.InitializeComponent();

            // Get two instances of the accelerometer:
            // One that returns the raw accelerometer data
            accelerometerOriginal = Accelerometer.GetDefault();
            // Other on which the 'ReadingTransform' is updated so that data returned aligns with the request transformation.
            accelerometerReadingTransform = Accelerometer.GetDefault();

            if(accelerometerOriginal == null || accelerometerReadingTransform == null)
            {
                rootPage.NotifyUser("No accelerometer found", NotifyType.ErrorMessage);
            }
            displayInformation = DisplayInformation.GetForCurrentView();
        }
开发者ID:t-angma,项目名称:Windows-universal-samples,代码行数:16,代码来源:scenario4_orientationchanged.xaml.cs

示例13: AppViewHelper_OrientationChanged

 private static async void AppViewHelper_OrientationChanged(DisplayInformation sender, object args)
 {
     if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
     {
         var statusBar = StatusBar.GetForCurrentView();
         if (sender.CurrentOrientation == DisplayOrientations.Landscape ||
             sender.CurrentOrientation == DisplayOrientations.LandscapeFlipped)
         {
             await statusBar.HideAsync();
         }
         else
         {
             await statusBar.ShowAsync();
         }
     }
 }
开发者ID:boubou10,项目名称:HFR10,代码行数:16,代码来源:AppViewHelper.cs

示例14: OrientationChanged

partial         void OrientationChanged(DisplayInformation info, object sender)
        {
            switch (info.CurrentOrientation)
            {
                case DisplayOrientations.Landscape:
                case DisplayOrientations.LandscapeFlipped:
                    PivotGrid(X, Y);

                    break;

                case DisplayOrientations.Portrait:
                case DisplayOrientations.PortraitFlipped:
                    PivotGrid(Y, X);

                    break;
            }
        }
开发者ID:edewit,项目名称:welcome-windows,代码行数:17,代码来源:MainPage.xaml.cs

示例15: OnNavigatedTo

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // Get two instances of the accelerometer:
            // One that returns the raw accelerometer data
            accelerometerOriginal = Accelerometer.GetDefault();
            // Other on which the 'ReadingTransform' is updated so that data returned aligns with the request transformation.
            accelerometerReadingTransform = Accelerometer.GetDefault();

            if(accelerometerOriginal == null || accelerometerReadingTransform == null)
            {
                rootPage.NotifyUser("No accelerometer found", NotifyType.ErrorMessage);
            }
            else
            {
                ScenarioEnableButton.IsEnabled = true;
            }

            // Register for orientation change
            displayInformation = DisplayInformation.GetForCurrentView();
            displayInformation.OrientationChanged += displayInformation_OrientationChanged;
        }
开发者ID:AJ-COOL,项目名称:Windows-universal-samples,代码行数:21,代码来源:Scenario4_OrientationChanged.xaml.cs


注:本文中的DisplayInformation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。