c# - Binding an Event to ViewModel: Extending an article -


i've been searching information on binding wpf events commands defined in viewmodel.

i know there many frameworks can me, don't want use of them, implement scratch see how it's working.

i've found article: http://blog.functionalfun.net/2008/09/hooking-up-commands-to-events-in-wpf.html

and in general it's good. however, i've got 2 questions:

  1. i'd have command parameter , bind parameter property in xaml (like commandparameter={binding ...}). how extend article handle ?

  2. in understanding in implementation use, let's say, mousedoubleclick event in 2 different ui elements, need define 2 different properties , attach them each of types want extend. isn't there smarter way (i.e. defining attached property once , use in elements)?

please consider using eventtocommand behavior mvvm light library. related article: commands, relaycommands , eventtocommand).

also, there alternative eventtocommand behavior (quote article):

note: can use invokecommandaction instead of mvvm light’s eventtocommand. behavior part of system.windows.interactivity dll. equivalent eventtocommand, without of advanced features.

the example of using invokecommandaction mentioned in note has been found here: executing command event of choice.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -