Skip to content

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

Closed

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}" />

Activity

  1. added this to the .NET 7 Planning milestone on Jul 22, 2022
  2. added
    legacy-area-controls
    on Jul 25, 2022
  3. modified the milestones: .NET 8 Planning, on Aug 16, 2023
  4. maxiking01 commented on Feb 19, 2024

    @maxiking01

    These function will be useful for Nullable DatePicker where a datepicker is hidden and should be opened when user clicks the control. So far the Nullable DatePicker was implemented using Focus, UnFocus function.

  5. mos379 commented on Apr 30, 2024

    @mos379
    Contributor

    Adding my support here! Really need some possibility to show a hidden picker on windows and ios

  6. SmartSquareAZ commented on May 7, 2024

    @SmartSquareAZ

    Is there progress on this topic? This function would be very nice!

  7. FreakyAli commented on May 13, 2024

    @FreakyAli

    +1

    Willing to work on this myself if I have to,

    @PureWeen can you confirm what's needed here?

  8. added and removed
    legacy-area-controls
    on May 13, 2024
  9. modified the milestones: , Backlog on Aug 2, 2024
  10. 12 remaining items

  11. self-assigned this
    on Apr 30, 2025
  12. moved this from Todo to In Progress in MAUI SDK Ongoingon Apr 30, 2025
  13. moved this from In Progress to Done in MAUI SDK Ongoingon Jul 30, 2025
  14. FreakyAli commented on Aug 1, 2025

    @FreakyAli

    NOW THIS IS A BANGER FOR .NET10 NGL

  15. locked and limited conversation to collaborators on Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions