locked
Why doesn't the imput binding work with the combobox? RRS feed

  • Question

  • <button aria-describedby="--stacks-s-tooltip-m8fc5vau" aria-label="Bookmark" aria-pressed="false" class="js-bookmark-btn s-btn s-btn__unset c-pointer py4 js-gps-track" data-controller="s-tooltip" data-gps-track="post.click({ item: 1, priv: 17, post_type: 1 })" data-s-tooltip-placement="right" data-selected-classes="fc-yellow-600"></button><svg aria-hidden="true" class="mln2 mr0 svg-icon iconHistory" height="18" viewBox="0 0 19 18" width="19"></svg>

    Normally, with textboxes, I use an input binding to bind it to the command in my view model. I do it in this way:

    <TextBox.InputBindings>
        <MouseBinding Gesture="LeftDoubleClick" Command="{Binding MyCommand}"/>
    </TextBox.InputBindings>

    This work if I set it in my textbox, but if I set it in my combobox, it doesn't work.

    <ComboBox.InputBindings>
        <MouseBinding Gesture="LeftDoubleClick" Command="{Binding MyCommand}"/>
    </ComboBox.InputBindings>

    How could I bind the doble click?

    Thanks.


    • Edited by ComptonAlvaro Friday, November 6, 2020 10:48 AM
    • Moved by CoolDadTx Friday, November 6, 2020 4:02 PM WPF related
    Friday, November 6, 2020 10:47 AM

All replies

  • This forum is for C#-specific questions. Your question is related to WPF data binding. Please post your question in the new Microsoft Q&A forums.

    Michael Taylor http://www.michaeltaylorp3.net

    Friday, November 6, 2020 4:01 PM
  • I'll assume you're talking about ASP.NET MVC that has a forum in ASP.NET forums.

    https://forums.asp.net/

    In case you are taking about WPF.

    https://docs.microsoft.com/en-us/answers/topics/wpf.html


    Friday, November 6, 2020 4:05 PM