Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

Once again me,.

I have one idea in tree view. In window form left side i put a frame, and right side one tree view. if i click any treeviewnode, suddenly the related page want to load in frame.

In asp,.

<treenode text="normal" navigateurl="detroit.aspx" target="frame2" />


I cant find the target and navigateurl in wpf.,

how i code for the change pages in frame when clicking treeview in wpf?,.


my frame code is,.

<Frame Height="449" HorizontalAlignment="Left" Margin="283,173,0,0" Name="frame1" VerticalAlignment="Top" Width="675" Source="normal.xaml" />
Posted
Updated 16-Feb-11 0:42am
v2

I find the Solution friends,.

In Xaml,.

<treeview height="294" horizontalalignment="Left" margin="48,240,0,0" name="treeView2" verticalalignment="Top" width="198" fontsize="20" fontfamily="Angsana New" selecteditemchanged="treeView2_SelectedItemChanged"> <treeviewitem header="Master" tag="non.xaml"> <treeviewitem header="Event" tag="nok.xaml">
<frame height="449" horizontalalignment="Left" margin="283,173,0,0" name="frame1" verticalalignment="Top" width="675" />


In code

private void treeView2_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
{
    TreeViewItem item = (TreeViewItem)treeView2.SelectedItem;
    frame1.Source = new Uri(item.Tag.ToString(), UriKind.RelativeOrAbsolute);

}</object>


This is perfictly working,.
 
Share this answer
 
Comments
Sagotharan Jagadeeswaran 16-Feb-11 23:34pm    
if u dont want frame buttons,.

then add,.
NavigationUIVisibility="Hidden"
Take a look at this article by Phil Winstanley:
Building WPF Applications with the Page Navigation framework (It's just like ASP.NET but with state...)[^]

There is an example doing nearly what you want on this page[^] (zip file attacked to answer[^])

Regards
Espen Harlinn
 
Share this answer
 
Comments
Sagotharan Jagadeeswaran 16-Feb-11 7:16am    
thank u friend,.
Espen Harlinn 16-Feb-11 11:26am    
Always nice to help. If you found the answer useful - voting and possibly marking the answer as correct/helpful would be appreciated :)
Sagotharan Jagadeeswaran 16-Feb-11 23:15pm    
voting is not possible in my account. I accept your answer. bzs it more help to me. thank u.
JF2015 17-Feb-11 1:02am    
5ed since the OP couldn't do it for some reason.
Sagotharan Jagadeeswaran 18-Feb-11 6:27am    
what is mean by op?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900