Rev | Line | |
---|
[12503] | 1 | using System;
|
---|
| 2 | using System.Collections.Generic;
|
---|
| 3 | using System.Linq;
|
---|
| 4 | using System.Text;
|
---|
| 5 | using System.Windows;
|
---|
| 6 | using System.Windows.Media;
|
---|
| 7 |
|
---|
| 8 | namespace Microsoft.Research.DynamicDataDisplay.Common.Auxiliary
|
---|
| 9 | {
|
---|
| 10 | internal static class VisualTreeHelperHelper
|
---|
| 11 | {
|
---|
| 12 | public static DependencyObject GetParent(DependencyObject target, int depth)
|
---|
| 13 | {
|
---|
| 14 | DependencyObject parent = target;
|
---|
| 15 | do
|
---|
| 16 | {
|
---|
| 17 | parent = VisualTreeHelper.GetParent(parent);
|
---|
| 18 | if (parent == null)
|
---|
| 19 | {
|
---|
| 20 | break;
|
---|
| 21 | }
|
---|
| 22 | } while (--depth > 0);
|
---|
| 23 |
|
---|
| 24 | return parent;
|
---|
| 25 | }
|
---|
| 26 | }
|
---|
| 27 | }
|
---|
Note: See
TracBrowser
for help on using the repository browser.