nerdexam
Microsoft

70-511 · Question #251

You use Microsoft .NET Framework 4 to create a Windows Forms application. The application has a reference to a Windows Presentation Foundation (WPF) class library named Library1. Library1 contains a…

The correct answer is D. ElementHost host = new ElementHost(). See the full explanation below for the reasoning.

Question

You use Microsoft .NET Framework 4 to create a Windows Forms application. The application has a reference to a Windows Presentation Foundation (WPF) class library named Library1. Library1 contains a WPF user control named UserControl1. You add the following code to the application:

You need to ensure that you can add the instance of UserControl1 to a control named host in Form1. Which code segment should you insert at line 09?

Exhibit

70-511 question #251 exhibit

Options

  • AWindowsFormsHost host = new WindowsFormsHost ();
  • BContainerControl host = new ContainerControl();
  • CPanel host = new Panel();
  • DElementHost host = new ElementHost();

How the community answered

(57 responses)
  • A
    12% (7)
  • B
    2% (1)
  • C
    7% (4)
  • D
    79% (45)

Community Discussion

No community discussion yet for this question.

Full 70-511 Practice