nerdexam
Microsoft

70-511 · Question #102

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

The correct answer is D. 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 Intl6 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 validation.
  • BRegister the property type of the Dependency property as Int16.
  • CSpecify code in the common language runtime (CLR) wrapper to adjust the value if it falls
  • DWithin the Dependency property's metadata, specify a callback for coercion.

How the community answered

(63 responses)
  • A
    5% (3)
  • B
    10% (6)
  • C
    2% (1)
  • D
    84% (53)

Community Discussion

No community discussion yet for this question.

Full 70-511 Practice