punker76 / MahApps.Metro.SimpleChildWindow

A simple child window for MahApps.Metro
MIT License
374 stars 55 forks source link

Passing value with Close not working #121

Closed ivanjx closed 4 years ago

ivanjx commented 4 years ago

Hi,

I am trying to pass a value from child window after it is closed. Here is what I have done:

// in child window.
Close("test");
// parent window.
string result = await ChildWindowManager.ShowChildWindowAsync<string>(
     m_mainWindow,
     childWindow);
return result != null;

But the result is always null in parent's code. What am I missing here?

Thanks.

Versions: image

punker76 commented 4 years ago

@realivanjx How is your ChildWindowManager.ShowChildWindowAsync implemented?

ivanjx commented 4 years ago

@punker76 I do not implement that function. I just called it. It is already there. Maybe i am using it wrong?

punker76 commented 4 years ago

@realivanjx Sorry, my fault. Can you provide this sample?

ivanjx commented 4 years ago

@punker76 Sorry, I think now it is working. I was testing with the code i attached before but the result is always null. Sorry for interrupting.