<Window x:Class="WpfApplication6.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApplication6"
mc:Ignorable="d" Background="OrangeRed"
Title="O WPF 4.5. Ksiega Eksperta" SizeToContent="WidthAndHeight">
<StackPanel>
<Label FontWeight="Bold" FontSize="20" Foreground="White">
WPF 4.5 Ksiega Eksperta
</Label>
<Label>2014 Helion</Label>
<Label>Zainstalowane rozdzialy:</Label>
<ListBox>
<ListBoxItem>Rozdzial 1</ListBoxItem>
<ListBoxItem>Rozdzial 2</ListBoxItem>
</ListBox>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<Button MinWidth="75" Margin="10">Pomoc</Button>
<Button MinWidth="75" Margin="10">OK</Button>
</StackPanel>
<StatusBar>Udalo sie prawidlowo zarejestrowac ten produkt</StatusBar>
</StackPanel>
</Window>
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace WpfApplication6
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
PrintLogicalTree(0, this);
}
void PrintLogicalTree(int depth, object obj)
{
Debug.WriteLine(new string(' ', depth) + obj);
if (!(obj is DependencyObject)) return;
foreach (object child in LogicalTreeHelper.GetChildren(obj as DependencyObject))
PrintLogicalTree(depth + 1, child);
}
}
}
Mam tu przyklad z ksiązki wydawnictwa Helion WPF 4.5 nt. tego jak wypisać drzewo logiczne. Nie rozumiem tylko co robi funkcja Debug.Writeline. Gdzie to drzewo jest wypisywane? Bo nie mogę coś go znaleźć.