Equivalence of command parameters in Windows Phone?

So, WPF has a CommandParameter attribute that you can use in your XAML code to send information about what is selected for your CS code to use.

I am trying to learn Windows Phone 7 and it seems very similar to WPF, so I decided to try using CommandParameter, but that does not work. Do you know the equivalent thing to use? Below is an example of my project ...

In Phone ApplicationBarMenuItem

<shell:ApplicationBarMenuItem x:Name="Download" Text="Download" Click="Download_Click"/>

I am trying to set CommandParameter = "{Binding Path = Id}" an attribute that you can use in WPF to send the id of the image populated with code for this rotation element so that the image is connected to my CS code so that I can perform these functions in the menu based on which page I'm on.

+3
source share
3 answers

Team support arrives at Mango (version 7.1), a beta version of which was released earlier this week.

+1
source

ApplicationBarMenuItem(i ApplicationBarIconButton) complicate the task, since they are not dependency objects (they directly extend the object), which means that they cannot have behaviors or triggers on them.

WP7 (Prism WP7) ApplicationBarButtonCommand (.. SDK Blend), ApplicationPage ICommand ApplicationBarIconButton. MenuItem.

+1

Silverlight and WP7 do not support the command; almost only a button supports it. You can use the EventToCommandBehavior from the MVVMLight Toolkit to bind a command to any event, including the click event.

0
source

All Articles