punker76 / MahApps.Metro.SimpleChildWindow

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

IsModal doesn't seem to have an effect #11

Closed mikecousins closed 9 years ago

mikecousins commented 9 years ago

View:

<simpleChildWindow:ChildWindow x:Class="Views.InviteWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:system="clr-namespace:System;assembly=mscorlib"
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        xmlns:simpleChildWindow="clr-namespace:MahApps.Metro.SimpleChildWindow;assembly=MahApps.Metro.SimpleChildWindow"
        Title="Invite New User" Height="200" Width="300" IsModal="True">

Calling code:

                var inviteWindow = new InviteWindow(emailAddress);
                var mainWindow = Application.Current.MainWindow as MainWindow;
                await mainWindow.ShowChildWindowAsync(inviteWindow);

With the above code I get the window appearing centered on the page. It does not cover the app with a translucent surface and mouse events are working fine so I can continue to interact with the application.

mikecousins commented 9 years ago

Nevermind, this was caused by me specifying Height and Width instead of ChildWindowHeight and ChildWindowWidth.