Click here to Skip to main content
15,898,222 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: background worker Pin
Ian Shlasko16-Feb-11 5:29
Ian Shlasko16-Feb-11 5:29 
GeneralRe: background worker Pin
Tesic Goran16-Feb-11 21:37
professionalTesic Goran16-Feb-11 21:37 
GeneralRe: background worker Pin
Pete O'Hanlon16-Feb-11 21:52
mvePete O'Hanlon16-Feb-11 21:52 
GeneralRe: background worker Pin
Pete O'Hanlon16-Feb-11 7:38
mvePete O'Hanlon16-Feb-11 7:38 
GeneralRe: background worker Pin
Tesic Goran16-Feb-11 21:24
professionalTesic Goran16-Feb-11 21:24 
GeneralRe: background worker Pin
Pete O'Hanlon16-Feb-11 21:50
mvePete O'Hanlon16-Feb-11 21:50 
QuestionMVVM Question Pin
_Maxxx_14-Feb-11 0:14
professional_Maxxx_14-Feb-11 0:14 
AnswerRe: MVVM Question Pin
Pete O'Hanlon14-Feb-11 0:22
mvePete O'Hanlon14-Feb-11 0:22 
_Maxxx_ wrote:
(Just to show I'm not a complete doofus, I am aware that most Messenger implementations avoid potential memory leaks by using WeakReferences, which may be an advantage - but is that the only reason for using it?)


No, that's not the only reason - in fact, routed events use weak references internally as well.

_Maxxx_ wrote:
I feel sure that there's a good reason for not doing this, but I'm stuffed if I can think what it is?


Decoupling. Purely and simply, decoupling. With event subscription you create an implicit hard relationship between the subscriber and the subscribee, so your ViewModels end up having knowledge of each other, which makes testing much more problematic. If you accept that one of the key tenets of MVVM is increasing testability then you see that having a mechanism that allows you to mock out the source of the "event" makes it much easier to test the VM.

I hope that helps.

I'm not a stalker, I just know things. Oh by the way, you're out of milk.

Forgive your enemies - it messes with their heads


My blog | My articles | MoXAML PowerToys | Onyx


GeneralRe: MVVM Question Pin
_Maxxx_14-Feb-11 0:37
professional_Maxxx_14-Feb-11 0:37 
GeneralRe: MVVM Question Pin
Pete O'Hanlon14-Feb-11 0:42
mvePete O'Hanlon14-Feb-11 0:42 
GeneralRe: MVVM Question Pin
_Maxxx_14-Feb-11 13:51
professional_Maxxx_14-Feb-11 13:51 
AnswerRe: MVVM Question Pin
lmoelleb14-Feb-11 1:47
lmoelleb14-Feb-11 1:47 
GeneralRe: MVVM Question Pin
Pete O'Hanlon14-Feb-11 5:13
mvePete O'Hanlon14-Feb-11 5:13 
GeneralRe: MVVM Question Pin
Mycroft Holmes14-Feb-11 13:36
professionalMycroft Holmes14-Feb-11 13:36 
GeneralRe: MVVM Question Pin
_Maxxx_14-Feb-11 13:58
professional_Maxxx_14-Feb-11 13:58 
GeneralRe: MVVM Question Pin
Mycroft Holmes14-Feb-11 14:06
professionalMycroft Holmes14-Feb-11 14:06 
AnswerRe: MVVM Question Pin
SledgeHammer0114-Feb-11 15:03
SledgeHammer0114-Feb-11 15:03 
GeneralRe: MVVM Question Pin
_Maxxx_14-Feb-11 17:03
professional_Maxxx_14-Feb-11 17:03 
GeneralRe: MVVM Question Pin
SledgeHammer0114-Feb-11 19:27
SledgeHammer0114-Feb-11 19:27 
GeneralRe: MVVM Question Pin
_Maxxx_14-Feb-11 23:19
professional_Maxxx_14-Feb-11 23:19 
GeneralRe: MVVM Question Pin
Pete O'Hanlon14-Feb-11 22:19
mvePete O'Hanlon14-Feb-11 22:19 
AnswerRe: MVVM Question Pin
Abhinav S14-Feb-11 18:21
Abhinav S14-Feb-11 18:21 
GeneralRe: MVVM Question Pin
_Maxxx_14-Feb-11 18:55
professional_Maxxx_14-Feb-11 18:55 
GeneralRe: MVVM Question [modified] Pin
SledgeHammer0115-Feb-11 7:31
SledgeHammer0115-Feb-11 7:31 
AnswerRe: MVVM Question Pin
BubingaMan22-Feb-11 0:05
BubingaMan22-Feb-11 0:05 

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.