So in WPF there is a CommandParameter attribute that you can use in your XAML code to send information about what is selected to your CS code to use.
I am trying to learn Windows Phone 7 programming and it seems very similar to WPF, so I thought I would try using CommandParameter, but this doesn't seem to work. Do you know of an equivalent thing to use? Below is some background on my project...
On the phone ApplicationBarMenuItem
<shell:ApplicationBarMenuItem x:Name="Download" Text="Download" Click="Download_Click"/>
I am trying to put a CommandParameter="{Binding Path=Id}" attribute like you can use in WPF to send the id of an image being populated in code for this pivot item that the image is on to my CS code so that I can do those functions in the menu based on which page I am on.
Command support is coming in Mango (version 7.1) the beta of which dropped earlier this week.
ApplicationBarMenuItem (and ApplicationBarIconButton) make things more complicated as they are not dependency objects (they extend Object directly), which means they can't have behaviors or triggers applied to them.
The WP7 Developer Guide (Prism for WP7) has a ApplicationBarButtonCommand behavior (ie. a Blend SDK Behavior) that can be applied to the ApplicationPage and will bind an ICommand to a ApplicationBarIconButton. You could easily created a MenuItem equivalent of it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With