public async void Associate(object obj) { PebbleConnector _pc = PebbleConnector.GetInstance(); { PebbleDeviceName = await _pc.GetCandidatePebble(); if (PebbleDeviceName != null) { String Message = String.Format("Device {0} found. Do you want to associate it?", PebbleDeviceName.Name); var messageDialog = new Windows.UI.Popups.MessageDialog(Message); messageDialog.Commands.Add(new UICommand("Yes", new UICommandInvokedHandler(this.PebbleAssociate))); messageDialog.Commands.Add(new UICommand("No")); await messageDialog.ShowAsync(); } } }