TreeView 기본 틀

C#/SilverLight 2012. 6. 1. 09:57 Posted by 퓨어레드

<!-- 네임 스페이스 선언 -->

<UserControl x:Class="FreeTest.MainPage"
    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:sdk="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

<Grid x:Name="LayoutRoot" Background="White">
        <sdk:TreeView>
            <sdk:TreeViewItem Header="바탕 화면">
                <sdk:TreeViewItem.Items>
                    <sdk:TreeViewItem>
                        <sdk:TreeViewItem.Header>
                            <TextBlock Text="내 문서" Margin="2" />
                        </sdk:TreeViewItem.Header>
                        <sdk:TreeViewItem.Items>
                            <sdk:TreeViewItem>
                                <sdk:TreeViewItem.Header>
                                    <TextBlock Text="내 사진" Margin="2" />
                                </sdk:TreeViewItem.Header>
                            </sdk:TreeViewItem>
                            <sdk:TreeViewItem>
                                <sdk:TreeViewItem.Header>
                                    <TextBlock Text="내 비디오" Margin="2" />
                                </sdk:TreeViewItem.Header>
                            </sdk:TreeViewItem>
                        </sdk:TreeViewItem.Items>
                    </sdk:TreeViewItem>
                </sdk:TreeViewItem.Items>
            </sdk:TreeViewItem>
        </sdk:TreeView>
    </Grid>
</UserControl>