public async void Connected() { await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => { switch (Controller.Vendor()) { case (ushort)VENDOR_ID.PLAYSTATION: GlobalSettings.ControllerType = CONTROLLER_TYPE.PLAYSTATION; break; case (ushort)VENDOR_ID.XBOX: GlobalSettings.ControllerType = CONTROLLER_TYPE.XBOX; break; default: GlobalSettings.ControllerType = CONTROLLER_TYPE.GENERIC; break; } Default_Controller_TextBlock.Text = ControllerDoctorUWP.Controller.TypeString(Controller.Vendor()); Controller_Connected_TextBlock.Text = "Yes"; Controller_Vendor_TextBlock.Text = "" + Controller.Vendor(); Controller_Product_TextBlock.Text = "" + Controller.Product(); Windows.Devices.Power.BatteryReport report = Controller.Battery(); if (report != null) { Controller_Battery_TextBlock.Text = report.RemainingCapacityInMilliwattHours + "%"; } }); }