Closed AndreasReitberger closed 5 years ago
you should use
var result = await this.ShowChildWindowAsync<TResult>(...));
where TResult is type of result object
public class Person
{
public string FirstName {get; set; }
}
var result = await this.ShowChildWindowAsync<Person>(...));
in your ChildWindow on Close event you should do something like
private void Button1_OnClick(object sender, RoutedEventArgs e)
{
var PersonTypeObject = new Person() {FirstName = "John"};
this.Close(PersonTypeObject);
}
@AndreasReitberger Was @gem81 able to help you with the code snippet?
@punker76 Yes, this works for me :)
@gem81 thank you for helping out!
you should use
var result = await this.ShowChildWindowAsync<TResult>(...));
where TResult is type of result objectpublic class Person { public string FirstName {get; set; } } var result = await this.ShowChildWindowAsync<Person>(...));
in your ChildWindow on Close event you should do something like
private void Button1_OnClick(object sender, RoutedEventArgs e) { var PersonTypeObject = new Person() {FirstName = "John"}; this.Close(PersonTypeObject); }
@gem81 thanks for the code snippet. but how can we proceed in MVVM style with Caliburn.micro? I am thinking of using Events with event aggregator. is there any more efficient way?
Hi, it's more a question like a bug.
When I use
var result = _parent.ShowMessageAsync(...)
I get a result if the dialog was confirmed or declined. How do I achive the same with the "ShowChildWindowsAsync(...)"?var result = await _parent.ShowChildWindowAsync(...);
How do I return a "MessageResult" when my ChildWindow is closed? I couldn't find a sample.
Thanks a lot!