# ContextDialogBehavior

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-xaml-interactions-custom/struct-contextdialogbehavior/

**struct** · [`ferroui-xaml-interactions-custom`](/docs/0.5.0/api/ferroui-xaml-interactions-custom/) · v0.5.0

```rust
struct ContextDialogBehavior
```

Behavior that manages a context dialog implemented using a `Popup`.

Deviation (DEVIATIONS.md, Behaviors): the events of the behavior are Rust handler lists
(`opened` and `closed`, which return the subscription),
declared to markup as plain events, so that the event triggers find them by name.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L28)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`dialog_content_property`](#function-dialog_content_property)
- [`is_open_property`](#function-is_open_property)
- [`placement_property`](#function-placement_property)
- [`is_light_dismiss_enabled_property`](#function-is_light_dismiss_enabled_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`dialog_content`](#function-dialog_content)
- [`set_dialog_content`](#function-set_dialog_content)
- [`is_open`](#function-is_open)
- [`set_is_open`](#function-set_is_open)
- [`placement`](#function-placement)
- [`set_placement`](#function-set_placement)
- [`is_light_dismiss_enabled`](#function-is_light_dismiss_enabled)
- [`set_is_light_dismiss_enabled`](#function-set_is_light_dismiss_enabled)
- [`opened`](#function-opened)
- [`closed`](#function-closed)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L36)

<a id="function-to_ref"></a>

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<ContextDialogBehavior>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L36)

<a id="function-dialog_content_property"></a>

### dialog_content_property

```rust
fn dialog_content_property() -> &'static StyledProperty<Option<Ref<Control>>>
```

Identifies the `DialogContent` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L61)

<a id="function-is_open_property"></a>

### is_open_property

```rust
fn is_open_property() -> &'static StyledProperty<bool>
```

Identifies the `IsOpen` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L61)

<a id="function-placement_property"></a>

### placement_property

```rust
fn placement_property() -> &'static StyledProperty<PlacementMode>
```

Identifies the `Placement` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L61)

<a id="function-is_light_dismiss_enabled_property"></a>

### is_light_dismiss_enabled_property

```rust
fn is_light_dismiss_enabled_property() -> &'static StyledProperty<bool>
```

Identifies the `IsLightDismissEnabled` property.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L61)

<a id="function-construct"></a>

### construct

```rust
fn construct() -> Self
```

Creates the class data; see `ferroui_base::FerroObject::construct`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L148)

<a id="function-new"></a>

### new

```rust
fn new() -> Ref<Self>
```

Creates a behavior.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L159)

<a id="function-dialog_content"></a>

### dialog_content

```rust
fn dialog_content(self: &Self) -> Option<Ref<Control>>
```

Gets or sets the dialog content. This is a property of the object model, and the content
of the behavior in markup.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L165)

<a id="function-set_dialog_content"></a>

### set_dialog_content

```rust
fn set_dialog_content(self: &Self, value: Option<Ref<Control>>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L169)

<a id="function-is_open"></a>

### is_open

```rust
fn is_open(self: &Self) -> bool
```

Gets or sets a value indicating whether the dialog is open. This is a property of the
object model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L175)

<a id="function-set_is_open"></a>

### set_is_open

```rust
fn set_is_open(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L179)

<a id="function-placement"></a>

### placement

```rust
fn placement(self: &Self) -> PlacementMode
```

Gets or sets the popup placement mode. This is a property of the object model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L184)

<a id="function-set_placement"></a>

### set_placement

```rust
fn set_placement(self: &Self, value: PlacementMode)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L188)

<a id="function-is_light_dismiss_enabled"></a>

### is_light_dismiss_enabled

```rust
fn is_light_dismiss_enabled(self: &Self) -> bool
```

Gets or sets a value that determines how the dialog can be dismissed. This is a property of
the object model.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L194)

<a id="function-set_is_light_dismiss_enabled"></a>

### set_is_light_dismiss_enabled

```rust
fn set_is_light_dismiss_enabled(self: &Self, value: bool)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L198)

<a id="function-opened"></a>

### opened

```rust
fn opened(self: &Self, handler: impl Fn(Option<&BoxedValue>, &EventArgs) -> () + 'static) -> Rc<dyn IDisposable>
```

Occurs when the dialog is opened.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L203)

<a id="function-closed"></a>

### closed

```rust
fn closed(self: &Self, handler: impl Fn(Option<&BoxedValue>, &EventArgs) -> () + 'static) -> Rc<dyn IDisposable>
```

Occurs when the dialog is closed.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/Behaviors/FerroUI.Xaml.Interactions.Custom/context_dialogs/context_dialog_behavior.rs#L208)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- [`AttachedToVisualTreeBehaviorImplExt`](/docs/0.5.0/api/ferroui-xaml-interactions-custom/trait-attachedtovisualtreebehaviorimplext/)
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`StyledElementImplExt`](/docs/0.5.0/api/ferroui-base/trait-styledelementimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- [`DisposingBehaviorImplExt`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-disposingbehaviorimplext/)
- [`StyledElementBehaviorImplExt`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-styledelementbehaviorimplext/)
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<ContextDialogBehavior>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`StyledElementImpl`](/docs/0.5.0/api/ferroui-base/trait-styledelementimpl/)
- [`StyledElementBehaviorImpl`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-styledelementbehaviorimpl/)
- [`DisposingBehaviorImpl`](/docs/0.5.0/api/ferroui-xaml-interactivity/trait-disposingbehaviorimpl/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)
- [`AttachedToVisualTreeBehaviorImpl`](/docs/0.5.0/api/ferroui-xaml-interactions-custom/trait-attachedtovisualtreebehaviorimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
