Skip to content
Jan Karger edited this page Jul 27, 2017 · 9 revisions

Usage

Directly in XAML

<simpleChildWindow:ChildWindow
                 IsOpen="{Binding IsChildWindowOpenOrNotProperty}"
                 HorizontalContentAlignment="Stretch"
                 VerticalContentAlignment="Stretch"
                 Padding="15"
                 ChildWindowImage="Error"
                 Title="TestChild 1">
  <Grid>
  </Grid>
</simpleChildWindow:ChildWindow>

Or with the ChildWindowManager

private async void OpenAChildWindow_OnButtonClick(object sender, RoutedEventArgs e)
{
  // opens a cool child window
  await this.ShowChildWindowAsync(new CoolChildWindow() { IsModal = false });
}

Overlay with Opacity

A modal ChildWindow uses by default the GrayBrush3 from MahApps for the OverlayBrush. So the overlay hides the complete content. You can use a SolidColorBrush with an opacity to make the overlay transparent.

<simpleChildWindow:ChildWindow.OverlayBrush>
  <SolidColorBrush Opacity="0.8" Color="{StaticResource Gray2}" />
</simpleChildWindow:ChildWindow.OverlayBrush>

image

Stretch with Margin

2014-12-13_23h46_00

Without Shadow

2014-12-13_23h46_16

AutoSize

2014-12-13_23h46_32

With Icon or IconTemplate

2014-12-14_21h20_55