I was not able to find any sample. I am wondering if there is any good sample. I want to be able to update frame.source based on selected items of the treeview. I generate all content with XMLDataprovider. Thank you in advance!
XAML:
<Window xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" mc:Ignorable="d" x:Class="TwoListboxes_2.MainWindow" xmlns:local="clr-namespace:TwoListboxes_2" Title="MainWindow" Width="1000" Height="700"> <Window.Resources> <local:UriConverter x:Key="UriConverter" /> <XmlDataProvider x:Key="PageData" XPath="/Pages" Source="Data/data.xml" /> <HierarchicalDataTemplate DataType="Page" ItemsSource="{Binding XPath=Level2}"> <TextBlock FontWeight="Bold" Text="{Binding XPath=@Name}" /> </HierarchicalDataTemplate> <HierarchicalDataTemplate DataType="Level2" ItemsSource="{Binding XPath=Level3}"> <TextBlock Foreground="Red" Text="{Binding XPath=@Name}" /> </HierarchicalDataTemplate> <DataTemplate DataType="Level3"> <TextBlock FontStyle="Italic" Text="{Binding XPath=@Name}" /> </DataTemplate> </Window.Resources> <Grid HorizontalAlignment="Left" VerticalAlignment="Top"> <Grid.ColumnDefinitions> <ColumnDefinition Width="215"/> <ColumnDefinition Width="1"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Grid > <Border HorizontalAlignment="Left"> <telerik:RadTreeView x:Name="Nav_ListBox" ItemsSource="{Binding Source={StaticResource PageData}, XPath=Page}" SelectedValuePath="@UriSource" /> </Border> </Grid> <Frame Grid.Column="2" x:Name="ContentFrame" JournalOwnership="OwnsJournal" NavigationUIVisibility="Visible" Width="Auto" Source="{Binding SelectedValuePath, Converter={StaticResourXML:ce UriConverter}, ElementName=Nav_ListBox, Mode=TwoWay}" /> </Grid> </Window>XML:
<?xml version="1.0" encoding="UTF-8"?> <Pages> <Page Name="Name 1" UriSource="Pages/Name1.xaml" /> <Page Name="Name 2" UriSource="Pages/Name2.xaml"> <Level2 Name="ALL1" UriSource="Pages/All1.xaml" /> <Level2 Name="ALL2" UriSource="Pages/All2.xaml" /> <Level2 Name="ALL3" UriSource="Pages/All3.xaml" /> </Page> <Page Name="Name 3" UriSource="Pages/Name3.xaml"> <Level2 Name="ALL4" UriSource="Pages/All1.xaml" > <Level3 Name="ALL3_1" UriSource="Pages/All1.xaml" /> <Level3 Name="ALL3_2" UriSource="Pages/All2.xaml" /> <Level3 Name="ALL3_3" UriSource="Pages/All3.xaml" /> </Level2> <Level2 Name="ALL5" UriSource="Pages/All2.xaml" /> <Level2 Name="ALL6" UriSource="Pages/All3.xaml" /> </Page> <Page Name="Name 4" UriSource="Pages/Name4.xaml" /> </Pages>