-2
I have a question about returning an object from a screen B to a screen A, for example.
I use the form below, hiding the ShowDialog
of the base class, making the "new Showdialog" return what I need. Follow code example of the screen class that will return the object:
private void Button_Click(object sender, RoutedEventArgs e)
{
//trato meu objeto
Close();
}
public new tipo_meu_objeto ShowDialog()
{
base.ShowDialog();
return meu_objeto;
}
I also know, through other questions already asked here, that there are other ways, such as using the instance of the screen created and accessing the variable through it.
My question is: What I exemplified is considered a good way to solve this? If not, what would be the best way to treat this case?
Thanks in advance.