private void OnDisplayResult(string message) { var e = DisplayResult; if (e != null) { _dispatcherInvoker.Invoke(() => e(this, new EventArgs <string>(message))); } }
private void OnCredentialRequiered(object sender, EventArgs <CredentialRequieredArgs> args) { var e = CredentialRequiered; if (e != null) { DispatcherInvoker.Invoke(() => e(sender, args)); } }
protected override void OnCollectionChanged(NotifyCollectionChangedEventArgs e) { // Be nice - use BlockReentrancy like MSDN said using (BlockReentrancy()) { NotifyCollectionChangedEventHandler eventHandler = CollectionChanged; if (eventHandler == null) { return; } Delegate[] delegates = eventHandler.GetInvocationList(); // Walk thru invocation list foreach (NotifyCollectionChangedEventHandler handler in delegates.Cast <NotifyCollectionChangedEventHandler>()) { NotifyCollectionChangedEventHandler handler1 = handler; _dispatcherInvoker.Invoke(() => handler1(this, e)); } } }