Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How do you access methods of user controls in a stack panel?

$
0
0

Hello Everyone,

Please forgive me, I am new to WPF and C# development.  However, I am sure this can be done based on what I have read.

I have a lot of custom user controls that basically manages CRUD operations, there is about 80 in all.

Based on the activity of the user, let say client data entry.  The client detail custom user control is loaded on the parent window inside a stack panel.  The client detail custom user control has CRUD methods (addRecord(), editRecord(), deleteRecord()).

I want the parent window to call the CRUD methods on the custom user controls when a user clicks on a button.  

For instance, on the parent window, when the user clicks the "Add Record" button, the addRecord() method on the custom user control is called.

And when I want the custom user control to call method that is on the parent, such as when the record is not saved and the user tries to close the window, I know how the keep the window from closing, however, sending the message to the parent window is tricky.

I tried several options and feel that I am close.  Thanks for any help that you can provide.

Thanks!


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>