PrepAway - Latest Free Exam Questions & Answers

Category: 70-502

Exam 70-502: TS: Microsoft .NET Framework 3.5, Windows Presentation Foundation Application Development

Which two actions should you perform?

You are creating a localized version of a Windows Presentation Foundation application.
The application is deployed to all users in an English-only version. The English-only version was created by using the following process:

The <UICulture>en-US</UICulture> elements were added to the application project files.
The elements that required localization were marked with the x:Uid attributes in XAML code.
You need to use minimum possible effort to create a localized version of the application without impacting the English-only version.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

Which XAML code fragment should you insert at line 03?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application-definition file contains the following XAML code fragment.

<Application.Resources>
<Style TargetType="Button" x:Key="buttons">
<Setter Property="Margin" Value="5" />
<Setter Property="Background" Value="Olive" />
</Style>
</Application.Resources>

You add a window to the application. The window includes the following XAML code fragment.
(Line numbers are included for reference only.)

01 <StackPanel>
02 <StackPanel.Resources>
03
04 <Setter Property="Button.Background" Value="Blue" />
05 </Style>
06 </StackPanel.Resources>
07 <Button Content="Open" />
08 </StackPanel>

You need to ensure that the Button control of the window meets the following requirements:
* The Margin property is set to 5.
* The Background property is set to Blue.

Which XAML code fragment should you insert at line 03?

Which XAML code fragment should you insert at line 10?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You write the following XAML code fragment.

01 <StackPanel.Resources>
02 <ControlTemplate x:Key="buttonTemplate" TargetType="{x:Type Button}">
03 <Grid>
04 <Rectangle x:Name="buttonBackground" Width="100" Height="30" Fill="Blue" />
05 <WrapPanel>
06 <Image x:Name="buttonImage" Width="20" Height="20" Source="buttonImage.jpg" />
07 <ContentPresenter Margin="10" />
08 </WrapPanel>
09 </Grid>
10
11 </ControlTemplate>
14 </StackPanel.Resources>

You plan to apply the buttonTemplate template to 20 buttons. You need to ensure that a sound file named soundFile.wav is played when the user moves the
mouse pointer over the image on any of the 20 buttons.
Which XAML code fragment should you insert at line 10?

Which code segment should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You use a template for button controls. The template is defined as a resource on the page that contains the button controls. The template has a key named tpCancel. You plan to add a button named Cancel to the user interface of the application. You need to ensure that the Cancel button uses the template.
Which code segment should you use?

Which XAML code fragment should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You write the following XAML code fragment.

<Rectangle Name="SplineTest">
<Rectangle.RenderTransform>
<TranslateTransform x:Name="SplineTestTrans" X="0" Y="0" />
</Rectangle.RenderTransform>
<Rectangle.Triggers>
<EventTrigger RoutedEvent="Rectangle.MouseLeftButtonDown">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>

</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Rectangle.Triggers>
</Rectangle>

You need to ensure that the Rectangle object shifts diagonally downwards when a user clicks it.
Which XAML code fragment should you use?

Which XAML code fragment should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application processes hospital medical records. The application contains a class named Patient that has a property named Age. You enter information about the patient in a window named Medical Form. In the window, you enter the age of the patient in a textbox named txtAge. You need to ensure that the application meets the following requirements:
* It updates the Age property automatically when you enter the age of the patient in the txtAge textbox.
* It updates the txtAge textbox automatically when you change the Age property of the Patient class.
Which XAML code fragment should you use?

Which code segment should you use?

You are creating a Windows Presentation Foundation GUI application by using Microsoft .NET Framework 3.5.
The application will process legal consent. You use the following code fragment to create a check box and two text boxes.
<Grid Height="214" Width="282">
<TextBox Height="21" Margin="132,36,30,0" Name="txtAge1" VerticalAlignment="Top" Text=" " />
<TextBox Height="21" Margin="133,81,29,0" Name="txtAge2" VerticalAlignment="Top" Text= " " />
<Label Height="23" Margin="66,0,96,54" Name="label1" VerticalAlignment="Bottom">
<Label.Content>
<MultiBinding Converter="{StaticResource myConsentConverter}" ConverterParameter="18">
<Binding ElementName="txtAge1" Path="Text" />
<Binding ElementName="txtAge2" Path="Text" />
</MultiBinding>
</Label.Content>
</Label>
</Grid>
The text boxes are used to enter the age of the applicants. You need to ensure that if you specify a value of 18 or more in the text boxes, the check box is selected.
Which code segment should you use?

Which XAML code fragment should you use?

You are creating a Windows Presentation Foundation application to track customer orders.
You use Microsoft .NET Framework 3.5 to create the application. The application contains an Order class. The Order class has two public properties named OrderDate and OrderID. The application also contains an ObservableCollection collection of Order objects. This collection is named OrderItems. You write the following XAML code fragment.
<Window.Resources>
<CollectionViewSource Source="{Binding Source={x:Static Application.Current}, Path=OrderItems}" x:Key="orders" />
</Window.Resources>
You add two ListBox controls to select orders based on the OrderID or the OrderDate properties. One ListBox control displays order dates and the other ListBox control displays order numbers. You need to bind the two ListBox controls so that the item selected in one control is reflected in the other control.
Which XAML code fragment should you use?


Page 6 of 9« First...45678...Last »