nerdexam
Microsoft

70-511 · Question #219

You are developing a Windows Presentation Foundation (WPF) application. A custom control has a dependency property that is bound to a property of type Int16 on a business layer object. You need to…

The correct answer is A. within the Dependency property's metadata, specify a callback for coercion. See the full explanation below for the reasoning.

Question

You are developing a Windows Presentation Foundation (WPF) application. A custom control has a dependency property that is bound to a property of type Int16 on a business layer object. You need to ensure that the bound value always falls within the range of an Int16 value, even if the value that the user enters does not. What should you do?

Options

  • Awithin the Dependency property's metadata, specify a callback for coercion.
  • Bwithin the Dependency property's metadata, specify a callback for validation.
  • CSpecify code in the common language runtime (CLR) wrapper to adjust the value if it falls
  • DRegister the property type of the Dependency property as Int 16.

How the community answered

(60 responses)
  • A
    78% (47)
  • B
    5% (3)
  • C
    3% (2)
  • D
    13% (8)

Community Discussion

No community discussion yet for this question.

Full 70-511 Practice