本文整理汇总了C#中DisplayInformation类的典型用法代码示例。如果您正苦于以下问题:C# DisplayInformation类的具体用法?C# DisplayInformation怎么用?C# DisplayInformation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DisplayInformation类属于命名空间,在下文中一共展示了DisplayInformation类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: GetMaxImageWidth
public static double GetMaxImageWidth(DisplayInformation display)
{
var maxImageWidth = Window.Current.Bounds.Width;
if (display.CurrentOrientation == DisplayOrientations.Landscape
|| display.CurrentOrientation == DisplayOrientations.LandscapeFlipped)
{
var frame = Window.Current.Content as Frame;
if (frame != null)
{
var page = frame.Content as Page;
if (page != null)
{
var bottomAppBar = page.BottomAppBar;
if (bottomAppBar != null)
maxImageWidth -= bottomAppBar.ActualHeight;
}
}
}
return maxImageWidth;
}
开发者ID:valeronm,项目名称:handyNews,代码行数:22,代码来源:ImageManager.cs
示例17: PageBaseOrientationChanged
private void PageBaseOrientationChanged(DisplayInformation sender, object args)
{
CheckOrientationForPage();
}
开发者ID:CADTraveller,项目名称:RecipeMaster,代码行数:4,代码来源:OrientationStateBehavior.cs
示例18: OnOrientationChanged
private void OnOrientationChanged(DisplayInformation sender, object args)
{
this.TransitionStoryboardState();
}
开发者ID:saimonazad,项目名称:Tie-a-Tie-Pro--Windowsphone,代码行数:4,代码来源:YouTubeViewer.xaml.cs
示例19: OnDpiChanged
/// <summary>
/// Event handler for the DpiChanged event.
/// </summary>
/// <param name="sender"></param>
/// <param name="args"></param>
private void OnDpiChanged(DisplayInformation sender, object args)
{
// If the DpiChanged event is raised then the DPI of the current view has changed. Since the image was generated
// at the old DPI, it should be re-rendered if possible to ensure the content does not display rendering artifacts due
// to scaling. Note the resulting content may be different than before if the tree has changed.
RenderImageSource();
}
开发者ID:oldnewthing,项目名称:old-Windows8-samples,代码行数:12,代码来源:Scenario1.xaml.cs
示例20: DisplayProperties_OrientationChanged
private void DisplayProperties_OrientationChanged(DisplayInformation dinfo, object sender)
{
lock(_eventLocker)
{
// Set the new orientation.
_orientation = ToOrientation(dinfo.CurrentOrientation);
// Call the user callback.
OnOrientationChanged();
// If we have a valid client bounds then update the graphics device.
if (_viewBounds.Width > 0 && _viewBounds.Height > 0)
Game.graphicsDeviceManager.ApplyChanges();
}
}
开发者ID:Zodge,项目名称:MonoGame,代码行数:15,代码来源:UAPGameWindow.cs
注:本文中的DisplayInformation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论