You will need to use interactions to execute the ie command to invoke the command on the event.
<Window xmlns:intr="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" > <intr:Interaction.Triggers> <intr:EventTrigger EventName="Loaded"> <intr:InvokeCommandAction Command="{Binding WindowLoaded}"/> </intr:EventTrigger> </intr:Interaction.Triggers> </Window>
Window.Interactivity namespace has EventTrigger and InvokeCommandAction.
Remember that the WindowLoaded
property is a property.
public ICommand WindowLoaded { get; set; }
Later you need to create a new RelayCommand / RoutedUICommand in order to actually receive the callback.
thanks
Nitin source share