Class ContentDialogHostBehavior
Provides attached behavior helpers for dialog hosts implemented with ContentPresenter.
Exposes attached properties to enable the behavior on any ContentPresenter, which will manage a Wpf.Ui.Controls.ContentDialogHostController for runtime dialog lifecycle handling:
- monitor ContentProperty changes
- invoke controller callbacks when a dialog is added/removed
- propagate the IsDisableSiblingsEnabledProperty setting to the controller
Typical usage: attach ContentDialogHostBehavior.IsEnabled="True" to a ContentPresenter
placed in the window to enable dialog isolation behavior for dialogs injected into that presenter.
public static class ContentDialogHostBehavior
- Inheritance
-
ContentDialogHostBehavior
- Inherited Members
Fields
IsDisableSiblingsEnabledProperty
Attached property which controls whether sibling elements should be disabled while a dialog is active. The value is forwarded to the internal controller managed by the behavior.
public static readonly DependencyProperty IsDisableSiblingsEnabledProperty
Field Value
IsEnabledProperty
Attached property that enables the behavior on a ContentPresenter when set to true. When enabled the behavior will create and manage an internal controller that reacts to Content changes.
public static readonly DependencyProperty IsEnabledProperty
Field Value
Methods
GetIsDisableSiblingsEnabled(ContentPresenter)
Helper for getting IsDisableSiblingsEnabledProperty from element.
[AttachedPropertyBrowsableForType(typeof(ContentPresenter))]
public static bool GetIsDisableSiblingsEnabled(ContentPresenter element)
Parameters
elementContentPresenterContentPresenter to read IsDisableSiblingsEnabledProperty from.
Returns
- bool
IsDisableSiblingsEnabled property value.
GetIsEnabled(ContentPresenter)
Helper for getting IsEnabledProperty from element.
[AttachedPropertyBrowsableForType(typeof(ContentPresenter))]
public static bool GetIsEnabled(ContentPresenter element)
Parameters
elementContentPresenterContentPresenter to read IsEnabledProperty from.
Returns
- bool
IsEnabled property value.
SetIsDisableSiblingsEnabled(ContentPresenter, bool)
Helper for setting IsDisableSiblingsEnabledProperty on element.
public static void SetIsDisableSiblingsEnabled(ContentPresenter element, bool value)
Parameters
elementContentPresenterContentPresenter to set IsDisableSiblingsEnabledProperty on.
valueboolIsDisableSiblingsEnabled property value.
SetIsEnabled(ContentPresenter, bool)
Helper for setting IsEnabledProperty on element.
public static void SetIsEnabled(ContentPresenter element, bool value)
Parameters
elementContentPresenterContentPresenter to set IsEnabledProperty on.
valueboolIsEnabled property value.