첨부 실행 코드는 나눔고딕코딩 폰트를 사용합니다.
본 블로그는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 블로그 콘텐츠 향상을 위해 쓰여집니다.

728x90
반응형
728x170

TestProject.zip
0.02MB

▶ HelpContent.xml

<HelpContent xmlns="">
    <Topic
        Header="Copyright Information"
        Source="Help/Copyright.xaml" />
    <Topic
        Header="Program Overview"
        Source="Help/Overview.xaml" />
    <Topic
        Header="The Menu">
        <Topic
            Header="The File Menu"
            Source="Help/FileMenu.xaml" />
        <Topic
            Header="The Help Menu"
            Source="Help/HelpMenu.xaml" />
    </Topic>
</HelpContent>

 

728x90

 

▶ HelpWindow.xaml

<Window x:Class="TestProject.HelpWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    WindowStartupLocation="CenterScreen"
    Width="800"
    Height="600"
    Title="도움말"
    FontFamily="나눔고딕코딩"
    FontSize="16"
    ShowInTaskbar="False">
    <Window.Resources>
        <XmlDataProvider x:Key="XMLDataProviderKey"
            Source="Help/HelpContent.xml"
            XPath="HelpContent" />
        <HierarchicalDataTemplate DataType="Topic" ItemsSource="{Binding XPath=Topic}">
            <StackPanel Orientation="Horizontal">
                <Image Name="image"
                    Margin="2" 
                    Stretch="None"
                    Source="Help/HelpImageQuestionMark.png" />
                <TextBlock
                    VerticalAlignment="Center"
                    FontSize="12pt" 
                    Text="{Binding XPath=@Header}" />
            </StackPanel>
            <HierarchicalDataTemplate.Triggers>
                <DataTrigger
                    Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type TreeViewItem}}, Path=HasItems}"
                    Value="True">
                    <Setter TargetName="image" Property="Image.Source" Value="Help/HelpImageClosedBook.png" />
                </DataTrigger>
                <DataTrigger
                    Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type TreeViewItem}}, Path=IsExpanded}"
                    Value="True">
                    <Setter
                        TargetName="image"
                        Property="Image.Source" 
                        Value="Help/HelpImageOpenBook.png" />
                </DataTrigger>
            </HierarchicalDataTemplate.Triggers>
        </HierarchicalDataTemplate>
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="33*"  />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="67*"  />
        </Grid.ColumnDefinitions>
        <TreeView Name="treeView" Grid.Column="0"
            ItemsSource="{Binding Source={StaticResource XMLDataProviderKey}, XPath=Topic}"
            SelectedValuePath="@Source"
            SelectedItemChanged="treeView_SelectedItemChanged" />
        <GridSplitter Grid.Column="1"
            HorizontalAlignment="Center"
            VerticalAlignment="Stretch"
            Width="6" />
        <Frame Name="frame" Grid.Column="2"
            Navigated="frame_Navigated" />
    </Grid>
</Window>

 

728x90
반응형
그리드형(광고전용)
Posted by 사용자 icodebroker
TAG , ,

댓글을 달아 주세요