PrepAway - Latest Free Exam Questions & Answers

Category: 70-502

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

Which code segment should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You are defining a template as a resource in the application. The template will be applied to a button. You need to ensure that the template definition meets the following requirements:
* An image must appear to the left of the button.
* The content for the button must appear to the right of the button image.
* The template must be restricted only to button controls.
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 line of code should you insert at line 09?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You write the following code segment.
(Line numbers are included for reference only.)

01 StackPanel stack = new StackPanel();
02 Content = stack;
03 Button btOpen = new Button();
04 btOpen.Content = "Open";
05 Setter setter = new Setter(Button.BackgroundProperty, Brushes.Blue);
06 Style style = new Style();
07 style.Setters.Add(setter);
08 stack.Children.Add(btOpen);
09

You need to ensure that the Button control has a blue background.
Which line of code should you insert at line 09?

Which XAML code fragment should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You create a window by using XAML code. You add a button to the window.
You need to ensure that the font weight of the button changes to bold when either of the following events occur:
* The mouse pointer is moved over the button.
* The button is focused.
Which XAML code fragment should you use?

Which code segment should you insert at line 03?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application contains a data source and a TextBox control named txtUnitPrice. The Text property of the txtUnitPrice control is bound to the data source by using two-way binding. You write the following code segment.

01 private void OverridePrice(decimal newPrice)
02 {
03
04 txtUnitPrice.Text = newPrice;
05 }
You need to ensure that after the OverridePrice method is called, changes to the data source do not propagate to txtUnitPrice.
Which code segment should you insert at line 03?

Which XAML code fragment should you use?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application contains a class named Place that has the following attributes:
* CityName: a string value that represents the name of a city
* State: a string value that represents the name of a state
* The application also has a collection of Place objects named places.
You need to create a Collection View on the places collection that meets the following requirements:
* The view is grouped by the state name.
* The view is sorted by the city name.
Which XAML code fragment should you use?

Which code segment should you insert at line 09?

You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application contains a CheckBox control named checkBox1 and a TextBox control named t1. The application contains the following code segment.

public class CheckBoxToColorConverter : System.Windows.Data.IValueConverter
{
public object Convert(object valueIn, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
bool isChecked = Convert.ToBoolean(valueIn) ;
switch (isChecked)
{
case true:
return "Green";

default:
break;
}

return "Red";
}
}

You write the following code fragment.

01 <Window.Resources>
02 <src:CheckBoxToColorConverterKey="checkBoxToColorConverter"/>
03 <Style x:Key="CheckBoxChecked">
04 <Setter Property="Control.Template" Value="checkBoxToColorConverter" >
05 </Setter>
06 </Style>
07 </Window.Resources>
08 <StackPanel>
09
10 <CheckBox Name="checkBox1">Check For Green</CheckBox>
11 </StackPanel>

You need to ensure that when checkBox1 is in the selected state, the background of t1 changes to red.
Which code segment should you insert at line 09?

Which XAML code fragment should you use?

You are creating a Windows Presentation Foundation application. You create the application by using Microsoft .NET Framework 3.5.
You create a window that has two tabs for the application. You associate the following XAML code fragment with the tab control that contains the two tabs.
<Window.Resources>
<c:PetSelection x:Key="myPetSelection" />
</Window.Resources>

You add a property named Index to the PetSelection class. You need to ensure that when the user clicks a tab, the SelectedIndex property value of the tab
control is transferred to the Index property of the myPetSelection object.
Which XAML code fragment should you use?


Page 4 of 9« First...23456...Last »