using System; using System.Collections.Generic; using System.Windows; namespace LaDOSE.DesktopApp.Utils { public static class WpfUtil { public static void AddUI(this ICollection collection, T item) { Action addMethod = collection.Add; Application.Current.Dispatcher.BeginInvoke(addMethod, item); } } }