locked
mvvc code syntax question

    Question

  • Hi,

    I have code which works that i am trying to clean up a bit.  i have mvvc code in an win store app (coming from that dev express win store addin) which i hacked together.  The below code has a command which is called print_PastReceipt (from a class which is in the codebehind).  But the app will not compile unless i have print_PastReceipt as its own method in the codebehind...this is obviously redudant as the the print_PastReceipt in the class does the work.  How do i tell the below command to use the print_PastReceipt in the class...i have tried various syntax but can not get it.  NB I am not familar with mvvc.

    Thanks for all input.

     <HyperlinkButton Content="print" Foreground="Gray"    >
                                                                    <dxmvvmui:Interaction.Behaviors>
                                                                        <dxmvvm:EventToCommand Command="{Binding print_PastReceipt}" EventName="Click" CommandParameter="{Binding ID}"/>
                                                                    </dxmvvmui:Interaction.Behaviors>
                                                                </HyperlinkButton>

    Thursday, March 05, 2015 9:34 PM

Answers

  • Hi Ireland,

    >>i have mvvc code in an win store app (coming from that dev express win store addin) which i hacked together

    From your description and code snippets, I think this question is related to DevExpress MVVM Framework, you'd better to get help at its official channel.

    By the way, it seems like you need to trigger command and pass parameter to it, in my experience, I would like to use MVVM Light Messenger to achieve this, you could find lots of resources using favorite search engine.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, March 06, 2015 3:55 AM
    Moderator
  • Your XAML markup is supposed to bind to an ICommand property called "print_PastReceipt" of the DataContext of the HyperlinkButton. If your code doesn't compile if you remove a method called "print_PastReceipt" from the code-behind of the view, you are hooking up this event handler somewhere else in your code or XAML markup. Search for all occurances of "print_PastReceipt" in your XAML file in Visual Studio and remove all except the one mentioned above. You should then be able to compile your application. The compiler doesn't check bindings so the above markup should compile even if you replace "print_PastReceipt" with anything else.


    Please remember to mark helpful posts as answer to close your threads and please start a new thread if you have a new question.

    Friday, March 06, 2015 9:40 AM

All replies

  • Hi Ireland,

    >>i have mvvc code in an win store app (coming from that dev express win store addin) which i hacked together

    From your description and code snippets, I think this question is related to DevExpress MVVM Framework, you'd better to get help at its official channel.

    By the way, it seems like you need to trigger command and pass parameter to it, in my experience, I would like to use MVVM Light Messenger to achieve this, you could find lots of resources using favorite search engine.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, March 06, 2015 3:55 AM
    Moderator
  • Your XAML markup is supposed to bind to an ICommand property called "print_PastReceipt" of the DataContext of the HyperlinkButton. If your code doesn't compile if you remove a method called "print_PastReceipt" from the code-behind of the view, you are hooking up this event handler somewhere else in your code or XAML markup. Search for all occurances of "print_PastReceipt" in your XAML file in Visual Studio and remove all except the one mentioned above. You should then be able to compile your application. The compiler doesn't check bindings so the above markup should compile even if you replace "print_PastReceipt" with anything else.


    Please remember to mark helpful posts as answer to close your threads and please start a new thread if you have a new question.

    Friday, March 06, 2015 9:40 AM