public static async Task DisplayMessage(this Page page, IAlertMessage messageToDisplay) { if (!string.IsNullOrEmpty(messageToDisplay.Accept) && messageToDisplay.AcceptCommand != null) { var response = await page.DisplayAlert( messageToDisplay.Title, messageToDisplay.Message, messageToDisplay.Accept, messageToDisplay.Cancel); if (response) { messageToDisplay.AcceptCommand.Execute(); } else { messageToDisplay.CancelCommand?.Execute(); } } else { await page.DisplayAlert( messageToDisplay.Title, messageToDisplay.Message, messageToDisplay.Cancel); messageToDisplay.CancelCommand?.Execute(); } }
/// <summary> /// Generate Alerts /// </summary> /// <param name="alertMessage"></param> public void PostMessage(IAlertMessage alertMessage) { if (TempData["AlertMessage"] == null) { TempData["AlertMessage"] = new List <IAlertMessage>(); } TempData.ToValue <List <IAlertMessage> >("AlertMessage").Add(alertMessage); }
protected async Task DisplayAlert(IAlertMessage alertMessage) { bool result = true; if (alertMessage.AlertType == AlertType.Confirmation) { result = await DisplayAlert("Confirm", alertMessage.Message, "Yes", "No"); } else { await DisplayAlert(alertMessage.AlertType.ToString(), alertMessage.Message, "OK"); } }
public MainViewModel(BluetoothController bluetoothController, IAlertMessage message) { _bluetoothController = bluetoothController; _message = message; _selectDeviceInteraction = new Interaction <IDevice[], IDevice>(); IncreaseSpeedCommand = ReactiveCommand.Create(() => { if (Speed == 100) { return(100); } return(Speed += 10f); }); DecreaseSpeedCommand = ReactiveCommand.Create(() => { if (Speed == 0) { return(0); } return(Speed -= 10f); }); _bluetoothController.IsEnabled.ToPropertyEx(this, x => x.IsEnabled); _bluetoothController.IsConnected.ToPropertyEx(this, x => x.IsConnected); _bluetoothController.SensorValue.ToPropertyEx(this, x => x.SensorValue); ScanCommand = ReactiveCommand.CreateFromTask <bool>(OnScanAsync); DigitalMoveCommand = ReactiveCommand.CreateFromTask <JoystickDirection>(OnDigitalMoveAsync); }
void IAlertService5.BeginSend(IAlertMessage message) { message.BeginSend(); }
void IAlertService5.BeginSend(IAlertMessage message) { message.BeginSend(); }
/// <summary> /// Genera Mensaje de Alerta Html Boostrap Dimissable /// </summary> /// <param name="html"></param> /// <param name="alertMessage"></param> /// <param name="hasIcon"></param> /// <returns></returns> public static IHtmlString Alert(this HtmlHelper html, IAlertMessage alertMessage, bool hasIcon = false) => Alert(html, alertMessage.MessageType, alertMessage.Title, alertMessage.Body, hasIcon);