Пример #1
0
        public static async void AddOnUi(this MapleDictionary collection, Title item)
        {
            var action = new Action(() => collection.Add(item));

            if (Application.Current == null)
            {
                action.DynamicInvoke();
            }
            else
            {
                await Application.Current.Dispatcher.BeginInvoke(action);
            }
        }
Пример #2
0
        public static void AddOnUI(this MapleDictionary collection, Title item)
        {
            var add = new Action(() => collection.Add(item));

            Application.Current.Dispatcher.BeginInvoke(add);
        }
Пример #3
0
        public static object AddOnUI(this MapleDictionary collection, Title item)
        {
            var add = new Action(() => collection.Add(item));

            return(Application.Current?.Dispatcher.BeginInvoke(add) ?? add.DynamicInvoke());
        }