You are developing a Windows Presentation Foundation (WPF) application to play audio files. You add MediaElement mediaElement1 and a Button control named btnPlayAudio to the design surface. The MediaElement co.. audio file. The LoadedBehavior attribute is

题目

You are developing a Windows Presentation Foundation (WPF) application to play audio files. You add MediaElement mediaElement1 and a Button control named btnPlayAudio to the design surface. The MediaElement co.. audio file. The LoadedBehavior attribute is set to Manual.You add the following code to the main Window.You set the command of the button to MediaCommands.Play.You need to ensure that the application will play the audio file when the button is pressed.What should you add to constructor of the main window ?()

A.

B.

C.

D.


相似考题
更多“You are developing a Windows Presentation Foundation (WPF) application to play audio files ”相关问题
  • 第1题:

    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application named MyApp.exe. You use Microsoft Windows Installer to package the application. You create an icon file named Application.ico. You need to associate Application.ico with MyApp.exe when it is deployed. What should you do?()

    • A、 Use the File Types Editor tool.
    • B、 Rename the icon file to MyApp.exe .ico.
    • C、 Set the AddRemoveProgramsIcon property to Application.ico.
    • D、 Use the File System Editor tool to set the Icon property to Application.ico.

    正确答案:D

  • 第2题:

    You are developing a Windows Presentation Foundation (WPF) application for a travel reservation system You need to ensure that users can select a range of travel dates. What should you do ?()

    • A、Add single DatePicker control to the design surface
    • B、Add single Calendar control to the design surface
    • C、Add single MediaElement control to the design surface to display a calendar
    • D、Add the appropriate Windows Forms references to the project references. Add a single Windows Forms DateTimePicker control to the design surface

    正确答案:B

  • 第3题:

    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You need to ensure that the application meets the following requirements: Displays a menu that is specific to the control selected by the user. Displays the menu next to the control. Which control should you use? ()

    • A、 Menu
    • B、 PopUp
    • C、 ListBox
    • D、 ContextMenu

    正确答案:D

  • 第4题:

    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application uses the drag-and-drop functionality. You need to ensure that the drag-and-drop operation is stopped when a user moves the cursor outside the boundaries of the application form. Which enumeration member should you use?()

    • A、 DragAction.Cancel
    • B、 DragAction.Drop
    • C、 DragDropEffects.None
    • D、 DragDropEffects.All

    正确答案:A

  • 第5题:

    You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You discover that when the application runs, a user control is not rendered correctly. You need to find out the user interface (UI) element of the window that is causing the rendering problem. What should you do?()

    • A、 Use the Local Window.
    • B、 Use the WPF Visualizer.
    • C、 Generate a trace log by using IntelliTrace.
    • D、 Set a breakpoint at the control. Run the application.

    正确答案:B

  • 第6题:

    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You use the ClickOnce deployment methodology to distribute the application. You need to store application-specific data along with read/write permissions without requiring elevated permissions for the application. Where should you store the application data?()

    • A、 In isolated storage.
    • B、 On the database server.
    • C、 In the ClickOnce data directory.
    • D、 In the App.config file of the application.

    正确答案:A

  • 第7题:

    单选题
    You are developing a Windows Presentation Foundation (WPF) application. You configure PresentationTraceSource to track errors in a bound TextBox control in the application. You need to choose the window that the Trace information is sent to Which Visual Studio window should you select ?()
    A

     Autos

    B

     Immediate

    C

     Locals

    D

     Output


    正确答案: D
    解析: 暂无解析

  • 第8题:

    单选题
    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You use the ClickOnce deployment methodology to distribute the application. You need to store application-specific data along with read/write permissions without requiring elevated permissions for the application. Where should you store the application data?()
    A

     In isolated storage.

    B

     On the database server.

    C

     In the ClickOnce data directory.

    D

     In the App.config file of the application.


    正确答案: B
    解析: 暂无解析

  • 第9题:

    单选题
    You are developing a Windows Presentation Foundation (WPF) application. You need to display HTML content from a Web Page on the WPF form. What should you do?()
    A

     Add a FlowDocumentReader control to the design surface. Then create a FlowDocument control.

    B

     Add a ContentControl control to the design surface. The reference a WebClient object to return an HTML string.

    C

     Add a DocumentViewer control to the design surface. The create a FixedDocument control.


    正确答案: B
    解析: 暂无解析

  • 第10题:

    单选题
    You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application uses data-bound controls. You discover that when the application is executed by users, one of the controls is not displayed properly. You need to view the property values assigned to the controls. What should you do?()
    A

     Use IntelliTrace. 

    B

     Use PresentationTraceSource.

    C

     Run the application in debug mode with Visual Studio 2010. Use the Auto window while you step through the application code.

    D

     Run the application in debug mode with Visual Studio 2010. Use the WPF Visualizer while you step through the application code.


    正确答案: A
    解析: 暂无解析

  • 第11题:

    单选题
    You are developing a Windows Presentation Foundation (WPF) application. The application contains stylized body text and heading text. The heading text is a slight variation of the body text. You need to ensure that if the body text changes, the heading text automatically inherits those changes. What should you do ?()
    A

     Set the Value property of the style setter to point to a static resource

    B

     Set the BasedOn property of the heading style to point to a static resource for the body text style

    C

     Set the Key property of the heading style to start with the name of the body text style

    D

     Set the TargetType property of the heading style to TextBlock


    正确答案: B
    解析: 暂无解析

  • 第12题:

    单选题
    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application uses the drag-and-drop functionality. You need to ensure that the drag-and-drop operation is stopped when a user moves the cursor outside the boundaries of the application form. Which enumeration member should you use?()
    A

     DragAction.Cancel

    B

     DragAction.Drop

    C

     DragDropEffects.None

    D

     DragDropEffects.All


    正确答案: D
    解析: 暂无解析

  • 第13题:

    You are developing a Windows Presentation Foundation (WPF) application The application is for commercial use and requires a valid license key to be entered. You create a project type of Class Library code to validate license keys You need to ensure that the user enters a valid license key during installation of the software. Which deployment should reference the class library?()

    • A、 Click Once
    • B、 Setup Project
    • C、 XBAP
    • D、 XCopy

    正确答案:B

  • 第14题:

    You create a Microsoft Windows Installer file for a Windows Presentation Foundation (WPF) application that requires Microsoft .NET Framework 4. You need to ensure that the installation starts only if .NET Framework 4 is already installed on the computer. What should you do?()

    • A、 Use a custom action. 
    • B、 Set the MinVersion property to .NET Framework 4.
    • C、 Set the Version property of Windows Installer to .NET Framework 4.
    • D、 Set the Version property of the Launch Condition to .NET Framework 4.

    正确答案:D

  • 第15题:

    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application has multiple data entry windows. Each window contains controls that allow the user to type different addresses for shipping and mailing. All addresses have the same format. You need to ensure that you can reuse the controls. What should you create?()

    • A、 a user control
    • B、 a data template
    • C、 a control template
    • D、 a control that inherits the Canvas class

    正确答案:A

  • 第16题:

    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You need to ensure that users can view content in a book-reading format that displays two pages at a time. Which control should you use?()

    • A、 FlowDocument 
    • B、 FlowDocumentReader
    • C、 FlowDocumentPageViewer
    • D、 FlowDocumentScrollViewer

    正确答案:B

  • 第17题:

    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You want to add an audio player that plays .wav or .mp3 files when the user clicks a button. You plan to store the name of the file to a variable named SoundFilePath. You need to ensure that when a user clicks the button, the file provided by SoundFilePath plays. What should you do?()

    • A、 Write the following code segment in the button onclick event.     System.Media.    SoundPlayer player = new System.Media.    SoundPlayer(SoundFilePath); player.play();
    • B、 Write the following code segment in the button onclick event.    MediaPlayer player = new MediaPlayer();     player.Open(new URI(SoundFilePath),    UriKind.Relative)); player.play();
    • C、 Use the following code segment from the PlaySound()    Win32 API function and call the PlaySound function in the button onclick event.    [sysimport(dll="winmm.dll")]     public static extern long PlaySound(String SoundFilePath, long hModule, long dwFlags);
    • D、 Reference the Microsoft.DirectX Dynamic Link Libraries.     Use the following code segment in the button onclick event.     Audio song = new Song(SoundFilePath);     song.CurrentPosition = song.Duration; song.Play();

    正确答案:B

  • 第18题:

    You are developing a Windows Presentation Foundation (WPF) application. You need to use XAML to create a custom control that contains two Button controls. From which base class should you inherit? ()

    • A、 FrameworkElement
    • B、 UIElement
    • C、 UserControl
    • D、 Button

    正确答案:C

  • 第19题:

    单选题
    You are developing a Windows Presentation Foundation (WPF) application.You need to display HTML content from a Web page on the WPF form. What should you do?()
    A

     Add a FlowDocumentReader control to the design surface. Then create a FlowDocument control.

    B

     Add a DocumentViewer control to the design surface. Then create a FixedDocument control.

    C

     Add a WebBrowser control to the design surface. Then use the Navigate method to navigate the URI object.

    D

     Add a ContentControl control to the design surface. Then reference a WebClient object to return an HTML string.


    正确答案: B
    解析: 暂无解析

  • 第20题:

    单选题
    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application that displays an image. You need to ensure that users can stretch and scale the image. Which control should you use?()
    A

     Frame

    B

     Slider

    C

     Viewbox

    D

     ScrollViewer


    正确答案: A
    解析: 暂无解析

  • 第21题:

    单选题
    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application that allows users to arrange images. You need to ensure that users can arrange child elements in a panel without affecting the size of the elements. You also need to ensure that child elements are oriented horizontally. Which control should you use?()
    A

     ListBox

    B

     DockPanel

    C

     WrapPanel

    D

     StackPanel


    正确答案: C
    解析: 暂无解析

  • 第22题:

    单选题
    You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application has multiple data entry windows. Each window contains controls that allow the user to type different addresses for shipping and mailing. All addresses have the same format. You need to ensure that you can reuse the controls. What should you create?()
    A

     a user control

    B

     a data template

    C

     a control template

    D

     a control that inherits the Canvas class


    正确答案: C
    解析: 暂无解析

  • 第23题:

    单选题
    You are developing a Windows Presentation Foundation (WPF) application. You are implementing a test strategy for the application. You need to ensure that the test class can repeat user input. From which base class should the test class inherit?()
    A

     AutomationElementIdentifier

    B

     AutomationPeer

    C

     Keyboard

    D

     UICues


    正确答案: B
    解析: 暂无解析