ModalDialog Class

Control to implement a modal dialog for displaying User Controls.

Definition

Namespace: Common.Wpf.Controls
Assembly: Common.Wpf.Controls (in Common.Wpf.Controls.dll) Version: 2.0.7
C#
public class ModalDialog : ContentControl
Inheritance
Object    DispatcherObject    DependencyObject    Visual    UIElement    FrameworkElement    Control    ContentControl    ModalDialog

Remarks

1. Add a namespace attribute to the root element of the markup file it is to be used in:
XAML
xmlns:cc="clr-namespace:Common.Wpf.Controls;assembly=Common.Wpf.Controls"
2. Define the control setting the ZIndex:
XAML
<cc:ModalDialog Panel.ZIndex="1" IsOpen="{Binding IsOpen}">
  <ContentControl Content="{Binding CurrentModalViewModel}"/>
</cc:ModalDialog>
3. In the ViewModel create the properties for binding:
C#
public ViewModelBase? CurrentModalViewModel => _modalNavigationStore.CurrentViewModel;
public bool IsOpen => _modalNavigationStore.IsOpen;

Constructors

ModalDialogInitializes a new instance of the ModalDialog class

Properties

IsOpenGets or sets the is open indicator.

Fields

IsOpenPropertyIdentifies the IsOpen dependency property.

See Also