PrepAway - Latest Free Exam Questions & Answers

Category: 70-506

Exam 70-506: TS: Silverlight 4, Development

Which HTML markup should you insert at line 03?

You are developing a Silverlight 4 application named MySilverlightApplication.xap. The application is hosted on a Microsoft ASP.NET Web page named default.aspx by using the following HTML markup. (Line numbers are included for reference only.)

01 <object data=”data:application/xsilverlight2,”type=”application/xsilverlight2″ width=”100%” height=”100%”>
02 <param name=”source” value=”ClientBin/MySilverlightApplication.xap”/>
03
04 </object>

The ASP.NET application has two string variables named strPrimaryEmail and strSecondaryEmail. You need to ensure that both variables are passed to the Silverlight application. Which HTML markup should you insert at line 03?

What should you do?

You are developing an application by using Silverlight 4 and Microsoft .NET Framework 4.
You add a BackgroundWorker object named worker to the application. You also add a CheckBox control named checkBox and a TextBlock control named statusTextBlock.
You add the follo wing code segment. (Line numbers are included for reference only.)

01 public MainPage()
02 {
03 InitializeComponent();
04 worker.WorkerReportsProgress = true;
05 worker.DoWork += new DoWorkEventHandler(worker_DoWork);
06 worker.ProgressChanged += new ProgressChangedEventHandler(worker_ProgressChanged);
07 }
08 private void worker_DoWork(object sender, DoWorkEventArgs e)
09 {
10 for (int i = 0; i < 100; i++) {
11 bool isChecked = checkBox.IsChecked.HasValue && checkBox.IsChecked.Value;
12 ExecuteLongRunningProcessStep(isChecked);
13 worker.ReportProgress(i);
14 }
15 }
16 private void worker_ProgressChanged(object sender, ProgressChangedEventArgs e)
17 {
18 statusTextBlock.Text = e.ProgressPercentage + “%”;
19 }

You attempt to run the application. You receive the following error message: “Invalid crossthread access.”
You need to ensure that worker executes successfully. What should you do?

What should you do?

You are developing a Silverlight 4 application named Contoso.Accounts.Ui. The application uses a Silverlight library named Contoso.Ui.Common. You use application library caching to reduce the size of the XAP file by deploying Contoso.Ui.Common as a separate zip file. You create the following XML file.

<xml version=”1.0″ >
<manifest xmlns:xsi=”http://www.w3.org/2001/XMLSchemainstance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”>
<assembly>
<name>Contoso.UI.Common</name>
<version>1.0.0.0</version>
<publickeytoken>5ca45a28299b8a35</publickeytoken>
<relpath>Contoso.UI.Common.dll</relpath>
<extension downloadUri=”Contoso.UI.Common.zip” />
</assembly>
</manifest>

You need to ensure that the Contoso.Ui.Common library will be packaged as a separate zip file.
What should you do?

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?

Which code segment should you use?

You are developing a shopping application by using Silverlight 4.
The application has a ListBox named lstBasket that contains the items in the shopping basket. You need to save the items in lstBasket to isolated storage. You also need to ensure that the items isolated storage are available to other Silverlight applications hosted on the same Web site.
Which code segment should you use?

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 an application by using Silverlight 4 and Microsoft .NET Framework 4.
You add a BackgroundWorker object named worker to the application. You also add a CheckBox control named checkBox and a TextBlock control named statusTextBlock.
You add the follo wing code segment. (Line numbers are included for reference only.)

01 public MainPage()
02 {
03 InitializeComponent();
04 worker.WorkerReportsProgress = true;
05 worker.DoWork += new DoWorkEventHandler(worker_DoWork);
06 worker.ProgressChanged += new ProgressChangedEventHandler(worker_ProgressChanged);
07 }
08 private void worker_DoWork(object sender, DoWorkEventArgs e)
09 {
10 for (int i = 0; i < 100; i++) {
11 bool isChecked = checkBox.IsChecked.HasValue && checkBox.IsChecked.Value;
12 ExecuteLongRunningProcessStep(isChecked);
13 worker.ReportProgress(i);
14 }
15 }
16 private void worker_ProgressChanged(object sender, ProgressChangedEventArgs e)
17 {
18 statusTextBlock.Text = e.ProgressPercentage + “%”;
19 }

You attempt to run the application. You receive the following error message: “Invalid crossthread access.”
You need to ensure that worker executes successfully. What should you do?

Which code segment should you use?

You are developing a shopping application by using Silverlight 4.
The application has a ListBox named lstBasket that contains the items in the shopping basket. You need to save the items in lstBasket to isolated storage. You also need to ensure that the items isolated storage are available to other Silverlight applications hosted on the same Web site.
Which code segment should you use?

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 Silver light 4 application. You host the application by using a Web application available at http://www.contoso.com. The Web application contains multiple Windows Communication Foundation (WCF) services hosted at http://www.contoso.com/internal and http://www.contoso.com/external. You need to ensure that only your Silverlight application can access the services at http://www.contoso.com/internal. You also need to ensure that other Silverlight applications created by external vendors can access the services at http://www.contoso.com/external.
What should you do?


Page 2 of 1012345...10...Last »