Click here to Skip to main content
15,880,392 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: MVVM Blues... Pin
Tom Delany26-Jan-12 10:53
Tom Delany26-Jan-12 10:53 
GeneralRe: MVVM Blues... Pin
SledgeHammer0126-Jan-12 12:24
SledgeHammer0126-Jan-12 12:24 
GeneralRe: MVVM Blues... Pin
Tom Delany26-Jan-12 14:25
Tom Delany26-Jan-12 14:25 
GeneralRe: MVVM Blues... Pin
Dean Oliver24-Jan-12 19:05
Dean Oliver24-Jan-12 19:05 
GeneralRe: MVVM Blues... Pin
SledgeHammer0125-Jan-12 13:37
SledgeHammer0125-Jan-12 13:37 
AnswerRe: MVVM Blues... Pin
Ravi Bhavnani25-Jan-12 12:25
professionalRavi Bhavnani25-Jan-12 12:25 
GeneralRe: MVVM Blues... Pin
Kevin Marois29-Jan-12 9:23
professionalKevin Marois29-Jan-12 9:23 
AnswerRe: MVVM Blues... Pin
Dean Oliver29-Jan-12 18:50
Dean Oliver29-Jan-12 18:50 
The whole point of MVVM is not to have code in your code behind. You want your view abstracted from the business logic as well as the data it is bound to. This approach of directly calling an event in the code behind, tightly couples everything. To conform more with mvvm, rather re-route the event through a command.
C#
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"


C#
<ListBox> 
<i:Interaction.Triggers>
                    <i:EventTrigger EventName="MouseDoubleClick">
                        <cmd:EventToCommand PassEventArgsToCommand="True" Command="{Binding CurrentItemCommand}"/>
                    </i:EventTrigger>
</i:Interaction.Triggers>
</ListBox>


You will need to download: System.Windows.Interactivity.dll for the expression blend sdk. To use this functionality.

I do believe that design patterns should only be used as a guideline for better development. not to be followed so strictly. But in this instance there is a better more mvvm type of solution. To what you suggesting with eventing.
GeneralRe: MVVM Blues... Pin
Kevin Marois30-Jan-12 7:49
professionalKevin Marois30-Jan-12 7:49 
GeneralRe: MVVM Blues... Pin
Dean Oliver30-Jan-12 18:02
Dean Oliver30-Jan-12 18:02 
GeneralRe: MVVM Blues... Pin
Kevin Marois30-Jan-12 8:03
professionalKevin Marois30-Jan-12 8:03 
GeneralRe: MVVM Blues... Pin
Dean Oliver30-Jan-12 18:03
Dean Oliver30-Jan-12 18:03 
GeneralRe: MVVM Blues... Pin
Pete O'Hanlon31-Jan-12 0:56
mvePete O'Hanlon31-Jan-12 0:56 
QuestionSilverlight App versus Silverlight Busines App Pin
Kevin Marois24-Jan-12 8:09
professionalKevin Marois24-Jan-12 8:09 
AnswerRe: Silverlight App versus Silverlight Busines App Pin
Abhinav S25-Jan-12 0:45
Abhinav S25-Jan-12 0:45 
Questiondynamicaly open elements from a xaml resource Pin
Giorgi Nistor23-Jan-12 22:37
Giorgi Nistor23-Jan-12 22:37 
AnswerRe: dynamicaly open elements from a xaml resource Pin
Giorgi Nistor23-Jan-12 23:50
Giorgi Nistor23-Jan-12 23:50 
GeneralRe: dynamicaly open elements from a xaml resource Pin
Giorgi Nistor25-Jan-12 4:07
Giorgi Nistor25-Jan-12 4:07 
QuestionMVVM architecture Pin
mi_n22-Jan-12 21:18
mi_n22-Jan-12 21:18 
AnswerRe: MVVM architecture Pin
Wayne Gaylard22-Jan-12 21:59
professionalWayne Gaylard22-Jan-12 21:59 
GeneralRe: MVVM architecture Pin
mi_n23-Jan-12 8:51
mi_n23-Jan-12 8:51 
GeneralRe: MVVM architecture Pin
Dean Oliver23-Jan-12 18:35
Dean Oliver23-Jan-12 18:35 
GeneralRe: MVVM architecture Pin
mi_n24-Jan-12 21:03
mi_n24-Jan-12 21:03 
AnswerRe: MVVM architecture Pin
Dean Oliver25-Jan-12 19:35
Dean Oliver25-Jan-12 19:35 
Questionconnectionstring Pin
arkiboys20-Jan-12 1:10
arkiboys20-Jan-12 1:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.