DCSIMG
ViewModel - Shimmy on .NET

Browse by Tags

All Tags » ViewModel (RSS)

LeakEvent → WeakEvent by Shimmy

I'm sure not any Silverlight developer is aware of the fact that when one subscribes to an event, a strong reference to the handler class ('target') is attached to the event source ('source'), hence, if the source object life-cycle is longer than the target, memory is leaked, becuase when you don't need the target anymore and all its references are removed, there is still one reference to it by that event handler in the source, and thus, won't get collected by GC. A strong...

Close window from ViewModel by Shimmy

Although this is somewhat corny, I will dedicate for it a post. Scenario: you want to close a window from the ViewModel, without exposing the Window to it. This can be done in a simple and clean way. (Some code removed for brevity) HTH, Shimmy XAML: < Window x : Name = "this" xmlns : i = "http://schemas.microsoft.com/expression/2010/interactivity" xmlns : ei = "http://schemas.microsoft.com/expression/2010/interactions" > < i : Interaction.Triggers > <...
Powered by Community Server (Commercial Edition), by Telligent Systems