protected virtual void OnStateChanged(InteractionStateChangedEventArgs args) { var temp = StateChanged; if (temp != null) { temp(this, args); } }
static void interaction_StateChanged(object sender, InteractionStateChangedEventArgs e) { var interation = (IInteraction)sender; interation.StateChanged -= interaction_StateChanged; var view = _openToasts.FirstOrDefault(v => v.Model.Interaction.Id == interation.Id); if (view != null) { _openToasts.Remove(view); if (Application.OpenForms.Count > 0) { Application.OpenForms[0].BeginInvoke(new Action(() => view.Close())); } else { } } }