private async void RestartSystem() { bool success = true; try { await deviceManagementClient.ImmediateRebootAsync(); } catch (Exception) { success = false; } StatusText.Text = success? "Operation completed" : "Operation failed"; }