PrepAway - Latest Free Exam Questions & Answers

Category: 70-506

Exam 70-506: TS: Silverlight 4, Development

Which XAML fragment should you use?

You are developing a Silverlight 4 application.
You have a collection named ColPeople of the List<Person> type. You define the Person class according to the following code segment.

public class Person
{
public string Name {get; set;}
public string Description { get; set; }
public string Gender { get; set; }
public int Age { get; set; }
public int Weight { get; set; }
}
You need to bind ColPeople to a ComboBox so that only the Name property is displayed.
Which XAML fragment should you use?

What should you do?

You are developing a Silverlight 4 application. The application defines the following XAML fragment. (Line numbers are included for reference only.)

01 <ComboBox>
02 <ComboBoxItem Content=”Item 1″ />
03 <ComboBoxItem Content=”Item 2″ />
04 <ComboBoxItem Content=”Item 3″ />
05 </ComboBox> The codebehind
file contains the following code segment. (Line numbers are included for reference only.)
06 void PrintText(object sender, SelectionChangedEventArgs args){
07
08 MessageBox.Show( “You selected ” + cbi.Content.ToString() + “.”);
09 }

You need to ensure that when the user selects an item in a ComboBox control, the content of the item is displayed. What should you do?

Which code segment should you insert at line 06?

You are developing a Silverlight 4 application.
The application contains an XAML page that defines the following Grid control.
<Grid Name=”gridBody” >
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock Text=”Employee Info” />
<TextBlock Text=”Please enter employee info” Grid.Row=”1″ Height=”20″ VerticalAlignment=”Top” />
<TextBox x:Name=”EmpInfo” Grid.Row=”1″ Margin=”0,25,0,0″ TextWrapping=”Wrap” /></Grid>

The codebehind file for myPage.xaml contains the following code segment. (Line numbers are included for reference only.)

01 public myPage()
02 {
03 InitializeComponent();
04
05 UserControl control = new MyCustomControl();
06
07 }
You need to replace the contents of the second row of gridBody with a user control of the MyCustomControl type. Which code segment should you insert at line 06?

Which XAML fragment should you use?

You are developing a Silverlight 4 application. The application defines the following three event handlers.
(Line numbers are included for reference only.)

01 private void HandleCheck(object sender, RoutedEventArgs e)
02 {
03 MessageBox.Show(“Checked”);
04 }
05
06 private void HandleUnchecked(object sender, RoutedEventArgs e)
07 {
08 MessageBox.Show(“Unchecked”);
09 }
10
11 private void HandleThirdState(object sender, RoutedEventArgs e)
12 {
13 MessageBox.Show(“Indeterminate”);
14 }

You need to allow a check box that can be selected, cleared, or set to Indeterminate. You also need to ensure that the event handlers are invoked when the user changes the state of the control. Which XAML fragment should you use?


Page 10 of 10« First...678910