Providing the particular field as an argument in the constructor of the second form? Or making the field as a public static property and then access it from the second form? Or are these completely different concepts and I am mixing up things? The forms do not share any parent child (MDI) relationship.
CodePudding user response:
Have a class that controls both forms. Let it subscribe to an event in the first form that triggers when the field changes, and then let the class update the second form with the changed value.
In that way, both forms are independent of each other. That's good since it produces cleaner code with fewer reasons for failure.
CodePudding user response:
One approach will be the one that @jgauffin mentioned.
To keep forms decoupled and reusable you can pass the object in the constructor of the second form. then INotifyPropertyChanged
can be used to update the other form(s) if required. INotifyPropertyChanged Interface will help you to understand how it works and sample code to use.