/// <summary> /// Shows the popup to the user based on provided informations /// </summary> /// <param name="viewmodel">The provided properties of this popup to show</param> /// <returns>If the popup takes user response, true when user accepts and false when not /// In case popup doesnt take any response from the user, always returns true when popup was shown succesfully</returns> public async Task <bool> DisplayPopupMessageAsync(PopupMessageViewModel viewmodel) { // If we dont want to get any user response... if (string.IsNullOrEmpty(viewmodel.AcceptButtonText)) { // Just show the message with provided informations await mUserDialogs.AlertAsync(viewmodel.Message, viewmodel.Title, viewmodel.CancelButtonText); // Return success afterwards return(true); } // Otherwise, show response popup var response = await mUserDialogs.ConfirmAsync(viewmodel.Message, viewmodel.Title, viewmodel.AcceptButtonText, viewmodel.CancelButtonText); // And return user's response return(response); }
public void AddMessage(PopupMessageViewModel msg) { Popups.Add(msg); }
public void InitializeMessageViewModelAndService() { service = new MockService("TestUser", "TestProject"); messageViewModel = new PopupMessageViewModel(service, MessageDisplayTime); }
public Task <bool> DisplayPopupMessageAsync(PopupMessageViewModel viewmodel) { return(null); }
/// <summary> /// Add message which will be displayed after next HTTP Request /// You can add multiple messages which will be stacked on the page /// </summary> /// <param name="message">message to display.</param> protected void AddMessage(PopupMessageViewModel message) { popupService.AddMessage(message); }
/// <summary> /// Add message which will be displayed after next HTTP Request /// You can add multiple messages which will be stacked on the page /// </summary> /// <param name="message">message to display.</param> /// public static void AddMessage(this TempDataDictionary tempData, PopupMessageViewModel message) { var messages = GetMessages(tempData); messages.Add(message); }