Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

I am working on wpf application, I have a tree structure,treeview control datasource is xml file which dynamically changed according to user authentication, how to call diffrenet user control within the parent window on the click of tree node.
Posted

Handle the event System.Windows.Forms.TreeView.AfterSelect (sometimes BeforeSelect is also needed). You can store practically anything in a list view item, so you can store instances of some class carrying data needed to process the required user control in a required way depending on what list view item is selected.

—SA
 
Share this answer
 
Comments
Tarun.K.S 17-Jul-11 14:52pm    
Its WPF SA.
First you design the application data model - the authentication probably maps to some kind of role system - a wrapper facade[^] around the datamodel, hopefully serverside, ensures that the user do no get unauthorized access. This layering of functionality may seem foreign at first, but it's an excellent example of SoC.

Then you design the application user interface - don't think about data at this point, focus on the workflow, then aesthetics.

When you have a decent UI, design your View-Model(s) in a manner that supports that UI. Try to avoid using prism and similar libraries, later on when you are familiar with wpf - you will be able to make informed decissions about when it's appropriate to use such framworks.

At that point, it's a good idea to take a look at caliburn[^]

Best regards
Espen Harlinn
 
Share this answer
 
v2

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