I have a question about returning an object from a B canvas to an A canvas, for example.
I use the form below, hiding the ShowDialog
of the base class, making the "new ShowDialog" return what I need. Here is a 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 created screen instance 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 handle this?
Thank you in advance.