InfinitusIT / DeviceExtCapabilitiesUniversal

A wrapper for detect a 2in1 convertible state using C# for Universal Apps. With a basic monitor.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Device Extensions Capabilities for Universal Apps

A wrapper for detect a 2in1 convertable's state using C# for Universal Apps. With a basic monitor.

You can download it in nuget:

https://www.nuget.org/packages/DeviceExtCapabilitiesUniversal/

And use like this:

  var mode = SystemMetricsInfo.GetDeviceSlateMode(); // Unknown, Normal, Tablet
  var state = SystemMetricsInfo.IsDocked(); // bool
  

or you can use a basic monitor:


  public SystemMetricsMonitor Monitor { get; set; }
  
  ...
  
  Monitor = new SystemMetricsMonitor();

  Monitor.DeviceUseModeChanged += Monitor_DeviceUseModeChanged;
  Monitor.DeviceDockedStatusChanged += Monitor_DeviceDockedStatusChanged;

  Monitor.Start(TimeSpan.FromMilliseconds(1000));
  

;)

Helpers:

https://github.com/adrianstevens/WPF-CSharp-2in1-mode-detection http://windowsdeveloper.de/artikel/wpf-erkennen-laptop-tablet-175661

Sample screenshots:

alt text alt text

About

A wrapper for detect a 2in1 convertible state using C# for Universal Apps. With a basic monitor.

License:Apache License 2.0


Languages

Language:C# 100.0%