The Misbehaving Dialog

Windows’ dialogs can be bad for your app

There’s a better way

InlineModalDialog, available in the latest version of WPF Contrib, works a bit differently:

How to use

Add the decorator below the element to be used as the container. Set the Target property to the container.

<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:av="http://schemas.codeplex.com/wpfcontrib/xaml/presentation"
             Name="RootContainer">
    <av:InlineModalDecorator Target="{x:Reference RootContainer}">

    </av:InlineModalDecorator>
</UserControl>

Create a dialog and show it:

var dialog = new InlineModalDialog
{
    Owner = this,
    Content = new MyDialogViewModel(),
};
dialog.Show();

The Owner can be any element contained within the Target specified in the decorator (or the target itself).

You may also use the new ShowInline() overloads in TaskDialog.

##

Limitations