Click here to Skip to main content
15,886,530 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a mainwindow with a toolbar, in it an Add and an Update button.
From this MainWindow I also have a ListView that contains multiple UserControl items.

Problem : when we are in one of the ListView Item (UserControl), I would hidden/unhidden the Add- and/or the Update button hidden


What I have tried:

Tried everything I've found on google and to no avail!
Posted
Updated 10-Jan-22 3:43am
Comments
#realJSOP 8-Jan-22 15:42pm    
Hiding/unhiding a control disturbs the user’s experience. You should enable/disable instead. Beyond that, you haven’t said what should trigger the hidden/visible state.
[no name] 9-Jan-22 0:19am    
Create a public static reference to MainWindow (in its constructor) and add public getters for the controls in question that you can reference in the user control.

You can make the control accessible by adding this attribute to the buttons in your toolbar in your xaml:

XAML
x:FieldModifier="public"
 
Share this answer
 
Solution 1 don't work for my!!
 
Share this answer
 
Comments
Richard Deeming 10-Jan-22 10:15am    
1) If you want to reply to a solution, click the "Have a Question or Comment?" button under that solution and post a comment. DO NOT post your comment as another "solution" to the question.

2) "Don't work" tells us precisely nothing. If you want someone to help you resolve a problem, you need to provide sufficient details of what you have tried, what the error is, and where you are stuck.

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