public static void RemoveOnUI <T>(this ICollection <T> collection, T item) { Func <T, bool> removeMethod = collection.Remove; DispatcherHelper.CheckBeginInvokeWithArgsOnUI(removeMethod, item); }
public static void AddOnUI <T>(this ICollection <T> collection, T item) { Action <T> addMethod = collection.Add; DispatcherHelper.CheckBeginInvokeWithArgsOnUI(addMethod, item); }