nerdexam
Microsoft

70-511 · Question #142

70-511 Question #142: Real Exam Question with Answer & Explanation

Sign in or unlock 70-511 to reveal the answer and full explanation for question #142. The question stem and answer options stay visible for context.

Question

You use Microsoft .NET Framework 4 to create a Windows Forms application. You plan to use a Windows Presentation Foundation (WPF) control of the UserControl1 type hosted in an ElementHos1 control named elementHost1. You write the following code segment. (Line numbers are included for reference only.) 01 Public Class UPFInUInforms 02 Public Sub WPFInWInforms() 03 InitializeComponent() 04 05 End Sub 06 Private Sub OnBackColorChange(ByVal sender As Object, ByVal propertyName As [String], ByVal value As Object) 07 Dim host As ElementHost = TryCast(sender, ElementHost) 08 Dim col As System.Drawing.Color = DirectCast(value, System.Drawing.Color) 09 Dim brush As New SolidColorBrush(System.Windows.Media.Color.FromRgb(col,R, col.G, col.B)) 10 Dim ucl As UserControll = TryCast(host.Child, UserControll) 11 ucl.Background = brush 12 End Sub 13 End Class You need to ensure that the application changes the background color of the hosted control when the background color of the form changes. Which code segment should you insert at line 04?

Options

  • AelementHostl.PropertyMap.Remove("BackColor")
  • BelementHost1.PropertyMap.Remove("Background")
  • CelementHostl.PropertyMap.Add("BackColor", New
  • DelementHostl.PropertyMap.Add("Background", New

Unlock 70-511 to see the answer

You've previewed enough free 70-511 questions. Unlock 70-511 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Full 70-511 Practice