Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GrammaticalOptimization/DynamicDataDisplay/Common/Auxiliary/DependencyObjectExtensions.cs @ 12503

Last change on this file since 12503 was 12503, checked in by aballeit, 9 years ago

#2283 added GUI and charts; fixed MCTS

File size: 572 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Windows;
6using System.Windows.Threading;
7
8namespace Microsoft.Research.DynamicDataDisplay.Common.Auxiliary
9{
10    public static class DependencyObjectExtensions
11    {
12        public static T GetValueSync<T>(this DependencyObject d, DependencyProperty property)
13        {
14            object value = null;
15            d.Dispatcher.Invoke(() => { value = d.GetValue(property); }, DispatcherPriority.Send);
16
17            return (T)value;
18        }
19    }
20}
Note: See TracBrowser for help on using the repository browser.