You are developing a Universal Windows Platform (UWP) app that uses XAML and C#. The app must use the
Model-View-ViewModel (MVVM) pattern.
The user interface (UI) triggers an event.
You need to bind the event to a view model method.
What should you do? interface is used a lot in MVVM applications.
A.
Create a custom behavior and attach the behavior to the UI element. Bind the behavior’s event trigger to the
command declared in the view model.
B.
Create an attached property of type ICommand. Bind the UI element’s event to the attached property.
C.
Assign the value of the DataContext property to the view model. Use the BindingExression.UpdateSource()
method to update the data source.
D.
Add a strongly-typed view model property to the view. In the code behind file for the view, invoke the view
model method.
Explanation:
Commands are an implementation of the ICommand interface that is part of the .NET Framework. This
https://msdn.microsoft.com/en-us/magazine/dn237302.aspx