Câu 6: 70-357: Developing Mobile Apps
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?
Nội dung câu hỏi
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?
Các lựa chọn
Đáp án được giữ gọn theo nhãn A, B, C, D trong phần bình chọn tương tác.
- 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.
Cộng đồng
0 bình luận công khai. Tên thành viên được ẩn một phần.
Chưa có bình luận. Mở giao diện tương tác để bắt đầu thảo luận.