These are chat archives for punker76/MahApps.Metro.SimpleChildWindow

1st
Sep 2015
Jon Alza
@jonny123d
Sep 01 2015 10:59
Hello, I'm using SimpleChildWindow in my solution. I can't see the controls that I'm adding to the SimpleChildWindow in design view in VisualStudio 2013, is any reason for that?
Jan Karger
@punker76
Sep 01 2015 11:04
@jonny123d you must set the IsOpen property to true, or just create a ContentControl/UserControl with your content and put this inside the SimpleChildWindow
Jon Alza
@jonny123d
Sep 01 2015 11:13
@punker76 Thank you for de answer. When I set the IsOpen property to true Visual Studio is "Not Responding"...
Jan Karger
@punker76
Sep 01 2015 11:17
@jonny123d yeah sorry, you should use the latest alpha version
Jon Alza
@jonny123d
Sep 01 2015 11:29
@punker76 Thank you! Now it works and I can see the design view.
Jon Alza
@jonny123d
Sep 01 2015 11:51
Another question about SimpleChildWindow and IsModal property. When I use MessageBox.Show(), the parent window is not reacheable, not even exit button. When I use SimpleChildWindow with IsModal property set to true, I can use all buttons from title bar. Is any way to get the same behaviour of MessageBox?
Jan Karger
@punker76
Sep 01 2015 11:52
@jonny123d not from the designer, but from code behind
@jonny123d you can set the OverlayFillBehavior to FullWindow
Jon Alza
@jonny123d
Sep 01 2015 11:57
@punker76 Oh great! Checked and running! Thank you again!
Jon Alza
@jonny123d
Sep 01 2015 14:30

Hello again, I'm back with another question, I want Window.ShowDialog() like behaviour, is it posible?

private async void ConnectClick(object sender, RoutedEventArgs e)
{
    if (this.connectWindow == null)
    {
        this.connectWindow = new ConnectWindow();
        this.connectWindow.UserLoggedIn += ConnectWindowUserLoggedIn;
    }
    //this.connectWindow.ShowDialog();
    await this.ShowChildWindowAsync(this.connectWindow, ChildWindowManager.OverlayFillBehavior.FullWindow);
    if (this.connectWindow.SuccessfulResult)
    {
        this.connect();
    }
}

With Window.ShowDialog() I wait until close the window and then I check SuccessfulResult property to know if I can connect or not. With SimpleChildWindow.ShowChildWindowAsync(), it doesn't wait until close the window to check the property.