Skip to content

How to intercept a bound command? #6391

@sam-wheat

Description

@sam-wheat

I wrote a simple control that displays a popup with a ListBox. Implementer of my control can bind a command to SelectionChangedCommand, which will execute when user selects an item from the ListBox. However, before SelectionChangedCommand executes, I want to set IsDropDownOpen property on my control to false which will close the popup.

Basically I want to intercept SelectionChangedCommand, set IsDropDownOpen to false, then allow SelectionChangedCommand to execute normally. How do I do this?

StaysOpen property of Popup does not achive the desired effect and in fact prevents the popup from closing when the mouse leaves.

Example project attached.

Thank you
CommandProblem.zip
.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionGeneral question, not a problem in source code or documentation (yet)

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions