I suggest you ...

Provide way for ICommands to determine the UIElement which owns the command

ICommands should have the ability, when executed, to determine which UIElement owns the command. Perhaps when event handlers are invoked, CallContext could be used to store the current UIElement 'sender'.

1 vote
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Pete BrownAdminPete Brown (Admin, Developer Community) shared this idea  ·   ·  Admin →

    2 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • mike.strobelmike.strobel commented  · 

        This breaks the command model. A command does not have an "owner". It can be executed from any source, and if the source is important to the handler (which it generally should not be), then you can include the source in the command argument.

      • Robert O'DonnellRobert O'Donnell commented  · 

        Why? assuming you're binding your command from your view model, the UIElement that it was attached to is irreleveant, and, you already have context with your view model...

      Feedback and Knowledge Base