Skip to content

Add "Open/Close" API to picker controls  #8945

@PureWeen

Description

@PureWeen

Spec: Add IsOpen Property, Events, and Commands to Control Picker

Description

Currently, the only way to open or close picker controls is by invoking platform-specific Focus or Unfocus methods. This approach is unintuitive and can lead to fragile, hard-to-maintain code.

To provide a more declarative and MVVM-friendly solution, we propose adding:

  • An IsOpen property to represent the open/closed state
  • Opened and Closed events for lifecycle awareness

Public API Changes

Properties

API Description
IsOpen Gets or sets whether the picker dialog is open.
  • IsOpen = true opens the picker.
  • IsOpen = false closes the picker.
  • Supports two-way binding for view model integration.

Events

API Description
Opened Raised when the picker dialog is opened.
Closed Raised when the picker dialog is closed.

Usage Scenarios

XAML: Two-way Binding

<DatePicker IsOpen="{Binding IsDatePickerOpen, Mode=TwoWay}" />

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions