Microsoft
70-518 · Question #203
You are designing a Windows Presentation Foundation (WPF) application. Business entity objects are bound to controls on each data entry window. The WPF application must meet the following…
The correct answer is B. Attach a custom attached property and an Adorner to each text box. See the full explanation below for the reasoning.
Question
You are designing a Windows Presentation Foundation (WPF) application. Business entity objects are bound to controls on each data entry window. The WPF application must meet the following requirements:
- Display a watermark in each empty text box.
- Display watermarks in a lighter color than user entries.
The watermark code must be reusable with other user interface controls. You need to recommend an approach for creating the watermarks. What should you recommend?
Options
- ACreate a value converter to format the bound value of the business entity objects.
- BAttach a custom attached property and an Adorner to each text box.
- CCreate handlers for the OnFocus and OnFocusLost events of the text boxes in the
- DModify each business entity object to return the watermark text if the property has no data.
How the community answered
(27 responses)- A4% (1)
- B78% (21)
- C11% (3)
- D7% (2)
Community Discussion
No community discussion yet for this question.