What should you do to control the position of the slider thumb by clicking the buttons on the window?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You add a Slider control and two buttons to a window of the application. You write the following code fragment.
(Line numbers are included for reference only.)
01 <StackPanel Orientation="Horizontal">
02 <RepeatButton
03
04 Content="Left"/>
05 <Slider Name="slider"/>
06 <RepeatButton
07
08 Content="Right"/>
09 </StackPanel>
You need to control the position of the slider thumb by clicking the buttons on the window.
What should you do?
What should you do to customize the appearance of all Button controls in the user control …?
You are creating a Windows Presentation Foundation user control by using Microsoft .NET Framework 3.5.
You need to customize the appearance of all Button controls in the user control such that the following requirements are met:
* Each Button control has a purple background and white text.
* Each Button control is rotated 45 degrees.
* No other Button properties are customized or redefined.
* The customizations are defined in a single location.
What should you do?
What should you do to ensure that the animation terminates when a user clicks the rectangle?
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You create a window by using the following XAML code fragment.
(Line numbers are included for reference only.)
01 <Rectangle x:Name="rect">
02 <Rectangle.Fill>
03 <SolidColorBrush x:Name="brush"/>
04 </Rectangle.Fill>
05 <Rectangle.Triggers>
06 <EventTrigger RoutedEvent="Rectangle.Loaded">
07 <BeginStoryboard x:Name="beginName">
08 <Storyboard x:Name="boardName">
09
10 </Storyboard>
11 </BeginStoryboard>
12 </EventTrigger>
13 <EventTrigger RoutedEvent="Rectangle.MouseLeftButtonDown">
14
15 </EventTrigger>
16 </Rectangle.Triggers>
17 </Rectangle>
You need to ensure that the animation starts when the rectangle is loaded. You also need to ensure that the animation terminates when a user clicks the rectangle.
What should you do?
What should you do to ensure that the check box displays the text “Is Active No” in the cleared st
You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You plan to add a check box to a window of the application. The check box must display the associated content and the text "Yes" or "No" instead of the check mark. You write the following XAML code fragment. (Line numbers are included for reference only.)
01 <Window.Resources>
02 <ControlTemplate x:Key="check" TargetType="CheckBox">
03 <DockPanel Name="dock">
04
05 <TextBlock Name="text"/>
06 </DockPanel>
07 <ControlTemplate.Triggers>
08 <Trigger Property="IsChecked" Value="False">
09
10 </Trigger>
11 </ControlTemplate.Triggers>
12 </ControlTemplate>
13 </Window.Resources>
14 <CheckBox Content="Is Active" Template="{StaticResource check}" />
You need to ensure that the check box displays the text "Is Active No" in the cleared state.
What should you do?
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?