/// <summary> /// Invoked when the interaction request is raised and displays /// a message box with content specified in the <see cref="InteractionRequestedEventArgs"/>. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected override void Notify(object sender, InteractionRequestedEventArgs e) { if (e == null) { return; } MessageBox.Show((string)e.Context.Content, e.Context.Title, MessageBoxButton.OK); if (e.Callback != null) { e.Callback.Invoke(); } }
/// <summary> /// Shows the popup for 6 seconds and then closes it. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected override void Notify(object sender, InteractionRequestedEventArgs e) { if (e == null) { return; } var popUp = (Popup)this.AssociatedObject.FindName(this.PopupElementName); popUp.DataContext = e.Context; popUp.IsOpen = true; this.DisposeTimer(); this.closePopupTimer = new Timer( s => Deployment.Current.Dispatcher.BeginInvoke(() => popUp.IsOpen = false), null, 6000, 5000); popUp.Closed += this.OnPopupClosed; }
private void DeletePriceListConfirmation(object o, InteractionRequestedEventArgs args) { (args.Context as Confirmation).Confirmed = true; args.Callback.Invoke(); }
void LaunchPopupRequest_Raised(object sender, InteractionRequestedEventArgs e) { OnPopupClosed(e.Context as Confirmation); }
private void EditValueSetConfirmation(object o, InteractionRequestedEventArgs args) { var confirmation = (Confirmation)args.Context; var propertyvalueVM = (PropertyValueBaseViewModel)confirmation.Content; if (propertyvalueVM.IsBooleanValue) { propertyvalueVM.InnerItem.Value.BooleanValue = true; } else if (propertyvalueVM.IsDateTimeValue) { propertyvalueVM.InnerItem.Value.DateTimeValue = DateTime.UtcNow; } else if (propertyvalueVM.IsDecimalValue) { propertyvalueVM.InnerItem.Value.DecimalValue = DecimalValue; } else if (propertyvalueVM.IsIntegerValue) { propertyvalueVM.InnerItem.Value.IntegerValue = 1234; } else if (propertyvalueVM.IsLongStringValue) { propertyvalueVM.InnerItem.Value.LongTextValue = LongTextValue; } else if (propertyvalueVM.IsShortStringValue) { propertyvalueVM.InnerItem.Value.ShortTextValue = "shrt"; } confirmation.Confirmed = true; args.Callback.Invoke(); }
/// <summary> /// Invoked when the interaction request is raised. /// </summary> /// <param name="sender">The sender of the event.</param> /// <param name="e">InteractionRequest events</param> protected void Notify(object sender, InteractionRequestedEventArgs e) { this.InvokeActions(e); }