Microsoft
70-511 · Question #104
You are developing a Windows Presentation Foundation (WPF) application. A UserControl named usercontroll contains the following controls. <StackPanei> <Label Name="Label1" Content="Hello Exam!!!" />…
The correct answer is A. var label = userControll.FindName ("label1") as Label. See the full explanation below for the reasoning.
Question
You are developing a Windows Presentation Foundation (WPF) application. A UserControl named usercontroll contains the following controls. <StackPanei> <Label Name="Label1" Content="Hello Exam!!!" /> </StackPanel> You need to ensure that the content of the label displays "New Content!!!" programmatically from the code-behind of the application window that contains the UserControl. Which code segment should you use?
Options
- Avar label = userControll.FindName ("label1") as Label;
- BuserControl1.Content = "New Content!!!";
- Cvar label = userControl1.FindResource("label1") as Label;
- DDependencyProperty dp =
How the community answered
(29 responses)- A76% (22)
- B3% (1)
- C14% (4)
- D7% (2)
Community Discussion
No community discussion yet for this question.