KnockOutJS – Multiple ViewModels in a single View

Knockout now supports multiple model binding. The ko.applyBindings() method takes an optional parameter – the element and its descendants to which the binding will be activated. For example: ko.applyBindings(myViewModel, document.getElementById(‘someElementId’)) This restricts the activation to the element with ID someElementId and its descendants. See documentation for more details.

MVVM Light: Adding EventToCommand in XAML without Blend, easier way or snippet?

Suppose you use .NetFramework4: First add namespace: xmlns:cmd=”clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Platform” Syntax for the Loaded event. <i:Interaction.Triggers> <i:EventTrigger EventName=”Loaded”> <cmd:EventToCommand Command=”{Binding Mode=OneWay, Path=LoadedCommand}” PassEventArgsToCommand=”True” /> </i:EventTrigger> </i:Interaction.Triggers>

tech