2019-03-09 14:03:25 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
|
|
|
|
|
|
namespace LaDOSE.DesktopApp.Utils
|
|
|
|
|
|
{
|
|
|
|
|
|
public static class WpfUtil
|
|
|
|
|
|
{
|
2019-03-13 00:59:40 +01:00
|
|
|
|
public static void AddUI<T>(this ICollection<T> collection, T item, Action action = null)
|
2019-03-09 14:03:25 +01:00
|
|
|
|
{
|
|
|
|
|
|
Action<T> addMethod = collection.Add;
|
|
|
|
|
|
Application.Current.Dispatcher.BeginInvoke(addMethod, item);
|
2019-03-13 00:59:40 +01:00
|
|
|
|
if(action!=null)
|
|
|
|
|
|
Application.Current.Dispatcher.BeginInvoke(action);
|
2019-03-09 14:03:25 +01:00
|
|
|
|
}
|
2019-03-13 00:59:40 +01:00
|
|
|
|
|
2019-03-09 14:03:25 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|