Line | |
---|
1 | using System;
|
---|
2 | using System.Collections.Generic;
|
---|
3 | using System.Linq;
|
---|
4 | using System.Text;
|
---|
5 | using System.Windows;
|
---|
6 | using System.Windows.Threading;
|
---|
7 |
|
---|
8 | namespace 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.