PrepAway - Latest Free Exam Questions & Answers

Tag: 70-506

Exam 70-506: TS: Silverlight 4, Development

Which XAML fragment or code segment should you use?

You are developing a browser hosted application by using Silverlight 4. The application runs in partial trust and uses the copy and paste functionality.
The application contains the following XAML fragment.
<TextBox x:Name=”textBoxClipBoard” />
You need to retrieve the contents of the Clipboard and display the contents in the TextBox. Which XAML fragment or code segment should you use?

Which code segment should you use?

You are developing a Silverlight 4 application. The Web page of the application contains a Text Box that has the txtTime ID. You define the following JavaScript function on the Web page.
function ShowTime(strTime) {
document.getElementById(‘txtTime’).value = strTime;
}
You need to pass the current time to the ShowTime function from Silverlight. Which code segment 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 code segment should you use?

You have a Silverlight 4 application that uses isolated storage.
You create an application that h as a 5 MB file that must be saved to isolated storage. Currently, the application has not allocated enough isolated storage to save the file.
You need to ensure that the application prompts the user to increase the isolated storage allocation.
You also need to ensure that only the minimum amount of space needed to save the 5 MB file is requested. Which code segment should you use?

Which two actions should you perform in the CheckNetworkStatusAndRaiseToast method?

You are developing an outofbrowser application by using Silverlight 4. The main page of the application contains the following code segment:

public MainPage()
{
InitializeComponent();
NetworkChange.NetworkAddressChanged += (s, e) => CheckNetworkStatusAndRaiseToast();
Check Network Status And Raise Toast();
}

You need to ensure that the application will raise a toast notification when network connectivity changes. Which two actions should you perform in the CheckNetworkStatusAndRaiseToast method? (Each correct answer presents part of the solution. Choose two.)

Which code segment should you insert at lines 11 and 12?

You are developing a ticketing application by using Silverlight 4.
You have a listbox named lstTickets that contains a list of the tickets. The page contains a button that allows the user to print the tickets. The PrintView UserControl binds to the type in lstTickets and is designed to fit a standard sheet of paper. You add the following code segment to the button event handler. (Line numbers are included for reference only.)

01 var doc = new PrintDocument();
02 var view = new PrintView();
03 doc.PrintPage += (s, args) =>
04 {
05 var ppc = doc.PrintedPageCount;
06 if (ppc < lstTickets.Items.Count)
07 {
08 var data = lstTickets.Items[ppc];
09 view.DataContext = data;
10 args.PageVisual = view;
11
12
13 }
14 };
15 doc.Print(“tickets”);

You need to use the Silverlight printing API to print each ticket on its own page. You also need to ensure that all tickets in the listbox are printed.
Which code segment should you insert at lines 11 and 12?

Which code segment should you use?

You are developing a Silverlight 4 application.
The application contains a Product class that has a public string property named Name.
You create a TextBox control by using the following XAML fragment.
<TextBox Text=”{Binding Name, ValidatesOnDataErrors=True}” />

You need to ensure that validation errors are reported to the user interface. You also need to ensure that a validation error will occur when the TextBox control is empty.
Which code segment should you use?

Which code segment should you add at line 06?

You are developing an application by using Silverlight 4 and Microsoft .NET Framework 4.
You add the following code segment. (Line numbers are included for reference only.)

01 var outerCanvas = new Canvas();
02 var innerCanvas = new Canvas();
03 innerCanvas.Width = 200;
04 innerCanvas.Height = 200;
05 outerCanvas.Children.Add(innerCanvas);
06

You need to set the distance between the left of the innerCanvas element and the left of the outerCanvas element to 150 pixels.
Which code segment should you add at line 06?


Page 8 of 10« First...678910