About Dialog with Tree Walking

image_pdfimage_print







1
2
3
4
5
6
7
8
9






text


//File:Window.xaml.cs

using System;
using System.Diagnostics;
using System.Windows;
using System.Windows.Media;

public partial class AboutDialog : Window
{
public AboutDialog()
{
InitializeComponent();
}

protected override void OnContentRendered(EventArgs e)
{
base.OnContentRendered(e);
PrintVisualTree(this);
}
void PrintVisualTree(DependencyObject obj)
{
Debug.WriteLine(obj);
for (int i = 0; i < VisualTreeHelper.GetChildrenCount(obj); i++) { PrintVisualTree(VisualTreeHelper.GetChild(obj,i)); } } } [/csharp]