The problem is really simple, but sometimes I see people tend to forget a little bit how the DataContext works in WPF and being stuck in wandering why a command is not invoked when a button inside a DataTemplate is pressed. Suppose you have a ListView bounds to a list of items called SingleResult, for [...]
Continue reading about Quick reminder on How-To map items of a list view to a VM command
I needed a simple way to obtain this simple result: whenever a certain component in the UI (a WebBrowser control) raises some specific event, I want a command in the VM to be executed, without the need to specify any command parameter. The only requirement I want is avoiding a single line of code in [...]
Continue reading about Event to Command in WPF MVVM application
I’m using in a project a modified version of MVVM in WPF originally made by my dear friend Mauro (check his project Radical, it is really cool). Actually I use a custom DelegateCommand to handle communication between View and the View Model. Here is a sample snippet on how I initialize a command in View [...]
Continue reading about Loving MMVM and asynchronous operations
When an object references another object, he prevent garbage collector to reclaim referenced objects, this fact is known by every developer and we need to pay specific attention when dealing with singleton objects. One of the most common risk is having a Singleton reference other objects and thus keeping them alive until the application consumes [...]
Continue reading about WeakReference to delegate.. are you sure it is a good idea?
Scenario: have a WPF application based on custom MVVM + Broker + Castle, the users told us that some operations took long time to accomplish and they want a wait cursor on the application. Resolution: Since all long operations are triggered with event handled by a Broker system, the obvious solution is an interceptor 1: [...]
Continue reading about MVVM + Broker + Castle Interceptor = FUN
