Since I think you are asking: "How do I approach this problem?" I can give you some suggestions.
You have two main problems:
- the mechanics of the effect you are trying to achieve.
- wiring that affects the architecture of your program.
For the first problem, I would recommend prototyping your effects with a simple application other than MVVM. In particular, you can use the VisualStateManager ideas on the link that you linked to, and Animation concepts that you are already familiar with, and good old-fashioned code, without complex libraries, to get the effect of inserting, moving, and deleting a tree. Remember that you will try to get rid of all the code later and that it is only for prototyping. Basically you port this link to the code and delete everything that it uses.
Once you get the effect that you are trying to achieve, you now have an old MVVM problem related to the fact that it works with your “loose-joint” look model. WPF makes data binding properties straightforward, so MVVM is MVVM worldwide for data. But for operations, there are many obstacles to clearly connecting events to operations, and each MVVM infrastructure seems to do it differently. MVVMLight has an EventToCommand and System.Windows.Interactivity has a CallMethodAction , and it goes on and on.
So, to integrate your effect with your choice of MVVM, use this structure mechanism to connect events to operations, whatever that is. However, you can always use a little code to work with your view or send events directly to your view model if you cannot find another way to make the glue work. It depends on you.
source share