Request: Support for ICommand on most if not all controls

Greetings,

I had a request for the "powers that be" :) That request is to consider adding support for ICommand to most if not all control events (ItemSelected, ItemTapped, etc). This would allow a great deal more flexibility in separating UI from logic.

Tagged:

Posts

  • ChaseFlorellChaseFlorell CAInsider, University mod
    edited January 2016

    Those are Events and not Properties.

    You can try adding a TapGestureRecognizer that accepts a Command and CommandParameter.

        <Label Text="{Binding SomeFooProperty}">
           <Label.GestureRecognizer>
               <TapGestureRecognizer Command="{Binding MyCommand}" CommandParameter="{Binding .}" />
           </Label.GestureRecognizer>
        </Label>
    
  • ravensorbravensorb USMember ✭✭

    Correct -- the idea of adding Properties for commands is so that you can support DataBinding to the commands (something you cannot do with the events)

    And I like your idea of the GestureRecognizer -- I'll give that a try. Thanks!

Sign In or Register to comment.