Communication between Forms

Asked

Viewed 399 times

2

I have a form that has a text editing component(RichTextBox) and create a search form (Find/famous CTRL+F). My question is how do I make one form "chat" with the other. For example, type something to search the search form and mark in the form that has the text editing component.

I initially thought of passing as a parameter the first form to the search, but it doesn’t seem right. Is it right to pass a window to another as a parameter? If the answer is no, how should this communication be done.

NOTE: remembering that I am using c# and WPF.

  • If you pass the whole window as a parameter, it will create a coupling between the two and this is not good from the maintenance point of view. I only messed with WPF once so I don’t remember, but if you can pass more parameters, follow the Android style and pass a copy of the data as parameter.

1 answer

0


Browser other questions tagged

You are not signed in. Login or sign up in order to post.