Sumeru Suresh
Sumeru Suresh

Reputation: 3181

how to Pass multiple parameters via Command Parameter in WPF?

how to Pass multiple parameters via Command Parameter in WPF?? Do we have to create an object and pass if so can someone help me with an example

Upvotes: 4

Views: 5209

Answers (2)

Captain
Captain

Reputation: 743

Maybe you can use MultiBinding with a converter that will create an object for you...

Upvotes: 4

arconaut
arconaut

Reputation: 3285

I'm guessing it would be sufficient to pass the underlying data context to the command? This means you can use sender's DataContext in the command's Executed handler, or set CommandParameter={Binding} in xaml.

If you see that you can't bind CommandParameter to a single object - this might be because of a bad design.

Upvotes: -2

Related Questions