Click here to Skip to main content
15,885,537 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,
I have a user control,now I want to add another user control)(tab in this user control and also want to access it from another window(not a user control )

how to do it kind of a lost in WPF

thanks in advance
Posted

You can add a property that holds the inner UserControl.
 
Share this answer
 
Accessing a control in another form is bad practice. If you insist on doing so, simply make the control public (by default, it's either protected or private).

Also, controls INSIDE the user control are also not public, so you may need to change their access level as well.

There are many other more correct ways to get to the data/properties of another form's control, one of which being a global static class that is manipulated by other objects (namely, forms) that set/get properties within that class, or an object internal to the form that contains the controls you want access to that exposes those controls' values.
 
Share this answer
 

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