PrepAway - Latest Free Exam Questions & Answers

Which code snippets should you insert in Target 1 and Target 2 to complete the code?

HOTSPOT
A class named AccountViewModel includes a property named Name that will be bound to a control.
The Name property will occasionally be updated programmatically. The updated values must
be reflected in the bound control.
You need to implement the interface so that the AccountViewModel class can inform WinRT
when there is a new value to display.
You have the following code:

Which code snippets should you insert in Target 1 and Target 2 to complete the code? (To
answer, select the correct code snippet from each drop-down list in the answer area.)

PrepAway - Latest Free Exam Questions & Answers

Answer:

Explanation:

Note:
* INotifyPropertyChanged
The INotifyPropertyChanged interface is used to notify clients, typically binding clients, that a
property value has changed.

* PropertyChangedEventHandler
Example:

// This is a simple customer class that
// implements the IPropertyChange interface.
public class DemoCustomer : INotifyPropertyChanged
{
// These fields hold the values for the public properties.
private Guid idValue = Guid.NewGuid();
private string customerNameValue = String.Empty;
private string phoneNumberValue = String.Empty;
public event PropertyChangedEventHandler PropertyChanged;
// This method is called by the Set accessor of each property.
// The CallerMemberName attribute that is applied to the optional propertyName
// parameter causes the property name of the caller to be substituted as an argument.


Leave a Reply