What do you do to ensure that the following requirements are met?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You write the following XAML code fragment.
(Line numbers are included for reference only.)
01 <StackPanel>
02 <StackPanel.Resources>
03 <Style TargetType="{x:Type Button}">
04
05 </Style>
06 </StackPanel.Resources>
07 …
08 </StackPanel>
You add three buttons to the StackPanel control. You need to ensure that the following requirements are met:
* The background color of each button turns green when the user moves the mouse pointer over the button.
* The background color of each button turns red when the user moves the mouse pointer away from the button.
What should you do?
What should you do to ensure that the XAML code fragment sorts the list of available cars correctly?
You are creating a Windows Presentation Foundation application for a car dealer. You use Microsoft .NET Framework 3.5 to create the application.
You are creating a window that will display a list of available cars. The list will be sorted on the basis of the Make property. You try to run the XAML code fragment for the window. The following section of the code fragment does not compile.
(Line numbers are included for reference only.)
01 <Window.Resources>
02 …
03 <CollectionViewSource x:Key="vw" Source="{StaticResource cars}">
05 <CollectionViewSource.SortDescriptions>
06 <SortDescription PropertyName="Make" />
07 </CollectionViewSource.SortDescriptions>
08 </CollectionViewSource>
09 </Window.Resources>
You receive the following error message: "Type ‘SortDescriptions’ was not found."
You need to ensure that the XAML code fragment sorts the list of available cars correctly.
What should you do?
What should you do to ensure that the data source is updated whenever the FirstName property changes?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application contains a Person object with a FirstName property. You bind the Person object to a data source that is used in several controls. You need to ensure that the data source is updated whenever the FirstName property changes.
What should you do?
What should you do to update the application so that both the border…?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You implement validation for a data bound text box control. When a user enters an invalid value in the text box, the border of the text box turns red. You need to update the application so that both the border and the text of the text box control turn red when an invalid value is entered.
What should you do?
What should you do to ensure the following requirements are met?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application displays an image that is defined as an application resource.
You need to ensure that the following requirements are met:
* The image file must appear in the output directory after the build.
* The image can be modified without being rebuilt.
What should you do?
What should you do to select a XAML element that provides the following functionality by default?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application will display articles that contain photographs, geometric figures, and other rich content. You plan to format the articles in flow documents.
You need to select a XAML element that provides the following functionality by default:
* Searches the content of any article.
* Views any article in single-page and multiple-page layouts.
* Adjusts the font size of the content.
What should you do?
What should you do to provide optimal performance when the audio file is being played?
You are creating a Windows Presentation Foundation application. You create a window for the application.
The application contains an audio file named AudioFileToPlay.wav.
You need to ensure that the following requirements are met:
* The audio file is played each time you click the client area of the window.
* The window provides optimal performance when the audio file is being played.
What should you do?
What should you do to ensure that the following requirements are met?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application defines a BrowserWindow class. Each instance of the BrowserWindow class allows the user to browse a Web site in a separate window.
When a new browser window is opened, the user is redirected to a predefined URL.
You write the following code segment.
01 private void OpenNewWindow(object sender, RoutedEventArgs e)
02 {
03 Thread newWindowThread = new Thread(new ThreadStart(NewThreadProc));
04
05 newWindowThread.Start();
06 }
07 private void NewThreadProc()
08 {
09
10 }
You need to ensure that the following requirements are met:
* The main window of the application is not blocked when an additional browser window is created.
* The application completes execution when the main window of the application is closed.
What should you do?
What should you do o ensure that the MenuItem control is disabled and the command is not executable?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You add a CommandBinding element to the Window element. The command has
a keyboard gesture CTRL+H. The Window contains the following MenuItem control.
<MenuItem Header="Highlight Content" Command="local:CustomCommands.Highlight" />
You need to ensure that the MenuItem control is disabled and the command is not executable when the focus shifts to a TextBox control that does not contain any text.
What should you do?
What should you do to perform the following tasks?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You need to perform the following tasks:
* Add a control to a window by using the following XAML code fragment.
<local:RedTextControl Background="Yellow" />
* Ensure that the background color of the control is yellow.
* Ensure that the foreground color is red
What should you do?