70-506

TS: Silverlight 4, Development


Topic 1, Main
QUESTION NO: 1
You work as a Silverlight 4.0 developer for ABC.com.
You have recently developed a Silverlight application named ABCApp. While testing ABCApp, you do a right-click within ABCApp that result in the Silverlight standard panel being displayed when the mouse button is released. You do not want this information to be displayed.
You notice that the layout root element of ABCApp is set up to manage the RightMouseButtonDown in the right way.
What should be done in this scenario?
A. You should consider making use of the MouseButtonEventArgs.Handled property, and setting it to FALSE.
B. You should consider making use of the MouseButtonEventArgs.Handled property, and setting it to TRUE.
C. You should consider making use of the MouseButtonEventArgs.OriginalSource property, and setting it to TRUE.
D. You should consider making use of the MouseButtonEventArgs.OriginalSource property, and setting it to FALSE.
Answer: B Explanation:

QUESTION NO: 2
You work as a Silverlight 4.0 developer for ABC.com.
ABC.com has a file server named ABC-SR13. You have developed a Silverlight application named ABCApp that sends files to ABC-SR13. You have configured ABCApp as a trusted application.
You are required the make sure that a user is able to select a file.
Which of the following actions should you take?
A. You should consider making use of the OpenFileDialog class to achieve your goal.
B. You should consider making use of the SaveFileDialog class to achieve your goal.
C. You should consider making use of the CopyFileDialog class to achieve your goal.
D. You should consider making use of the CloseFileDialog class to achieve your goal.

Answer: A Explanation:

QUESTION NO: 3
You work as a Silverlight 4.0 developer for ABC.com.
ABC.com has a file server named ABC-SR13. You have developed a Silverlight application named ABCApp that sends files to ABC-SR13. You have configured ABCApp as a trusted application.
You are required the make sure that a user is able to select a file.
What should be done in this scenario? Select two or three.
A. You should make use of the File.SpecialFolder method.
B. You should make use of the Environment.SpecialFolder method.
C. You should make use of the File.GetFolderPath method.
D. You should make use of the Environment.GetFolderPath method.
Answer: B,D Explanation:

QUESTION NO: 4
You work as a Silverlight 4.0 developer for ABC.com.
You have developed a Silverlight application, named ABCApp13. You have configured a control within ABCApp13 to show a picture. You notice that the picture is being presented upside down.
You decide to make use of XAML code to configure the application to correct the presentation of the picture.
Which of the following is TRUE with regards to the required code? (Choose all that apply.)
A. Your code should include the CompositeTransform class combined with the Dispatcher property.
B. Your code should include the CompositeTransform class combined with the SkewY property.
C. Your code should include the CompositeTransform class combined with the Rotation property.
D. Your code should include the CompositeTransform class combined with the SkewX property.

Answer: C Explanation:

QUESTION NO: 5
You work as a Silverlight 4.0 developer for ABC.com.
There is a Silverlight application named ABCApp7.
ABCApp has three VisualStates OK, HalfOK, and NotOK.
You want to make sure that the NotOK VisualState changes to the OK VisualState in 7 seconds exactly.
Which of the following actions should you take?
A. You should create an XAML code segment that makes use of the VisualTransition class, and includes the GeneratedDuration Property.
B. You should create an XAML code segment that makes use of the VisualState Class class, and includes the GeneratedDuration Property.
C. You should create an XAML code segment that makes use of the VisualStateGroup Class class, and includes the GeneratedDuration Property.
D. You should create an XAML code segment that makes use of the VisualStateChangedEventArgs Class class, and includes the GeneratedDuration Property.
Answer: A Explanation:

QUESTION NO: 6
You work as a Silverlight 4.0 developer for ABC.com. You are currently creating a Silverlight application named ABCApp7.
ABCApp7 has a page, named ABCPage, which includes a text box control named ABCTB. ABCApp7 also includes a ControlTemplate, which has been set up as a Resource.
You want to make sure that ABCTB makes use of this resource via XAML code.
Which of the following actions should you take?

A. You should consider making use of the segment below:
B. You should consider making use of the segment below:
C. You should consider making use of the segment below:
D. You should consider making use of the segment below:
Answer: A Explanation:

QUESTION NO: 7
You work as a Silverlight 4.0 developer for ABC.com. You have created a Silverlight application named ABCApp13.
ABCApp13 has a page, named ABCPage, which includes a text box named ABCTB.
You have written the segment shown below:

Which of the following options are TRUE with regards to using this segment?
A. It defines an explicit style for ABCTB.
B. It defines an implicit style for ABCTB.
C. It defines an explicit style for ABCPage.
D. It defines an implicit style for ABCPage.
Answer: B Explanation:
QUESTION NO: 8

XAML exhibit:

You work as a Silverlight 4.0 developer for ABC.com.
There is a Silverlight application named ABCApp.
ABCApp includes the code being displayed in the exhibit.
You are now required to add a customer control in relation to the definition in the exhibit.
Which of the following actions should you take?
A. You should consider writing code that makes use of the BaseOn property.
B. You should consider writing code that makes use of the TargetType property.
C. You should consider writing code that makes use of the IsSealed property.
D. You should consider writing code that makes use of the Setter property.
Answer: D Explanation:

QUESTION NO: 9
You work as a Silverlight 4.0 developer for ABC.com.
There is an MS Visual Studio 2010/Silverlight 4.0 application named ABCApp21 that should be configured to support three languages. There should be only three resource files, one for each language. ABCApp should choose the proper language with no additional code.
Which of the following file extensions should form part of the resource naming solution?
A. .res
B. .resx
C. .xml
D. .xaml
Answer: B Explanation:
QUESTION NO: 10

You work as a Silverlight 4.0 developer for ABC.com.
There is a Silverlight/MS Visual Studio 2010 web site named ABCSite. English, German, Spanish, Arabic, Swahili and French are used within ABCSite. ABCSite stack panel control for the user controls must be set up to be able show languages that
are bidirectional.
What should be done in this scenario?
A. You should consider setting the HorizontalAlignment property of the stack panel control.
B. You should consider setting the VerticalAlignmentproperty of the stack panel control.
C. You should consider setting the FlowDirection property of the stack panel control.
D. You should consider setting the Orientation property of the stack panel control.
Answer: A Explanation:

QUESTION NO: 11
You work as a Silverlight 4.0 developer for ABC.com. ABC.com has a Silverlight/MS .NET 4.0 application named ABCApp, which includes a DataGrid.
You have written the following code:


Which of the following is TRUE with regards to using this code? (Choose all that apply.)
A. At design time, the DataGrid is bound to the ABCList property in CRDABCVM.
B. At run time, the DataGrid is bound to the ABCList property in CRDABCVM.
C. At design time, the DataGrid is bound to the ABCList property in ABCVM
D. At run time, the DataGrid is bound to the ABCList property in ABCVM.
Answer: A,D Explanation:

QUESTION NO: 12
You work as a Silverlight 4.0 developer for ABC.com. You are creating a Silverlight application named ABCApp32.
There is an assembly, named ABCAss.dll, which contains a resource dictionary named ABCLibrary.XAML. The App.XAML file currently contains code that defines an assembly named Assets that includes the Styles.xaml resource dictionary.
You need to make sure that the App.xaml file contains the appropriate code to include the ABCLibrary.xaml resource dictionary.
Which of the following options represents the required code?
A.
B.
C.


D.
Answer: A Explanation:

QUESTION NO: 13
You work as a Silverlight 4.0 developer for ABC.com.
ABC.com has a Silverlight application named ABCApp15 that has an Employee class configured. The Employee class has a public property named Hiredate, which is set as nullable. You have configured a DataGrid control, named ABCC, whose second column is bound to Hiredate.
You are required to make sure that the column presents the the data by making use of the long date format.
Which of the following actions should you take?
A. You should consider making use of the binding expression shown below: {Binding Path=Hiredate, UpdateSourceTrigger=\{0:D\}}
B. You should consider making use of the binding expression shown below: {Binding Path=Hiredate, StringFormat=\{0:D\}}
C. You should consider making use of the binding expression shown below: {Binding Path=Hiredate, RelativeSource=\{0:D\}}
D. You should consider making use of the binding expression shown below: {Binding Path=Hiredate, TargetNullValue='hiredate'}
Answer: B Explanation:
QUESTION NO: 14

You work as a Silverlight 4.0 developer for ABC.com.
You are in the process of developing a Silverlight application named ABCApp15. You have configured the use of a class named Employee, which has a public property named Hiredate that. You have also included a TextBox control named ABCC in ABCApp15.
You have received instructions to make sure ABCC changes in the appropriate manner when Hiredate is updated, but HireDate should not change when ABCC changes.
You have decided to make use of OneWay data binding.
Which of the following is the interface that you should apply in the Emploee object as part of your solution?
A. INotifyPropertyChanged
B. INotifyPropertyChanging
C. INotifyDataErrorInfo
D. IRevertibleChangeTracking
Answer: A Explanation:

QUESTION NO: 15
You work as a Silverlight 4.0 developer for ABC.com.
You are in the process of developing a Silverlight application named ABCApp that includes a text box control named ABCC. You have set the DataContext property of ABCC to an object named ABCObject, which is exposed by a datetime property named HireData.
You want to make sure that the text ��The hire data of this employee is��, and the the value of the HireData property is displayed in ABCC. You have to define the binding expression.
Which of the following is the type of code you should use?
A. XAML.
B. ASPX.
C. XML.
D. HTML.

Answer: A Explanation:

QUESTION NO: 16
You work as a Silverlight 4.0 developer for ABC.com. You have created a Silverlight application named ABCApp17, which includes an Employees class and a BoolToVisibilityConverter class.
The Employees class has a property IsOnLeave which is of type Boolean. ABCApp17 also includes an XAML page named ABCPage. You have configured data binding between ABCPage and an instance of the Employee class.
You have configured ABCPage to include a Button control named ABCButton. You want to make sure that ABCButton only displays if the IsOnLeave property is set to FALSE.
You start by configuring a Resource block to include an instance of the BoolToVisibilityConverter class.
Which of the following actions should you take NEXT?
A. You should consider applying an instance of the BoolToVisibilityConverter class to the binding syntax of the Buttons Visibility property.
B. You should consider applying an instance of the BoolToVisibilityConverter class to the binding syntax of the Buttons DataContext property.
C. You should consider removing the data binding between ABCPage and the instance of the Employee class.
D. You should consider configuring data binding between ABCApp17 and an instance of the BoolToVisibilityConverter class.
Answer: B Explanation:

QUESTION NO: 17
You work as a Silverlight 4.0 developer for ABC.com.
You have developed a Silverlight application, named ABCApp, which includes a page named ABCPage. A TextBox control named ABCC has been includes in the ABCPage.

You have configured data binding between ABCC and a class that only executes the INotifyPropertyChanged interface. A ValidationException is thrown the Set block of the Name property of the class whenever a user types and enters incorrect data into ABCC.
You then write the XAML segment shown below:

Which of the following options is a result of this code?
A. The validation error will be displayed.
B. The validation error will not be displayed.
C. The validation error will be deleted.
D. The validation error will be disabled.
Answer: A Explanation:
QUESTION NO: 18
You work as a Silverlight 4.0 developer for ABC.com. You are in the process of creating a Silverlight application named ABCApp.
You have configured ABCApp to include a form named ABCForm, which is configured to include a GridControl named ABCGC.
You have been instructed to make sure that validation errors are summed up and presented to ABCApp users.
Which of the following actions should you take?
A. You should consider adding a ListBox control, setting the NotifyOnValidationError to true, and also setting the Mode to TwoWay.
B. You should consider adding a ListBox control, setting the NotifyOnValidationError to true, and also setting the Mode to OneTime.
C. You should consider adding a ListBox control, setting the NotifyOnValidationError to true, and also setting the Mode to OneWay.
D. You should consider adding a ListBox control, setting the OnValidation to true, and also setting the Mode to TwoWay.

Answer: A Explanation:

QUESTION NO: 19
You work as a Silverlight 4.0 developer for ABC.com. You are in the pocess o creating a Silverlight application named ABCApp.
You have configured ABCApp to include an Employee class, a public string property BestManager, and a public ObservableCollection property Managers. The Employee class is configured to apply the INotifyPropertyChanged interface.
You are preparing to define a user control using a ListBox and TextBox. You want to make sure that the text of the TextBox is ��Nothing is in focus" when nothing is selected in the ListBox. You should also make sure that whenever an item of the ListBox is selected, the Employee Class BestManager property is changed. Furthermore, if the content of the TextBox is changed to a proper member of the Managers collection, then the selected property of the ListBox is changed accordingly.
Which of the following actions should you take?
A. You should consider writing the code shown below:
B. You should consider writing the code shown below:
C. You should consider writing the code shown below:


D. You should consider writing the code shown below:
Answer: B Explanation:

QUESTION NO: 20
You work as a Silverlight 4.0 developer for ABC.com. You are in the process of creating a Silverlight application named ABCApp.
You have configured ABCApp to include a page named ABCPage that includes a control named ABCC. ABCC provides the user of ABCApp to select display options.
You have written the code shown below:





Which of the following statements are TRUE with regards to the code you have written? (Choose two.)
A. It allows the user to choose between the 800x600, and 600x400 window sizes.
B. It only allows the user to choose a red, blue, or green background when the the 800x600 window size is selected C. It only allows the user to choose a red, blue, or green background when the the 600x400 window size is selected

D. It allows users to choose between the red, blue, or green backgrounds in any window size.
Answer: A,D Explanation:

QUESTION NO: 21
You work as a Silverlight 4.0 developer for ABC.com. There is a Silverlight application named ABCApp. ABCApp has a page named ABCPage. ABCPage has a control named ABCMedia that handles media.
You are preparing to write code to handle the post playing of the media.
Which of the following should be used as part of the code?
A. A MarkerReached Event.
B. A MediaEnded Event.
C. A MediaFailed Event.
D. A CurrentStateChanged Event.
Answer: B Explanation:

QUESTION NO: 22
You work as a Silverlight 4.0 developer for ABC.com. You are creating a Silverlight application named ABCApp15 that includes a page named ABCPage. You have configured ABCPage to include a grid control named ABCGC. You have written the code shown below:









Which of the following options are TRUE with regards to using this code?
A. It allows ABCGC to have five columns that are each 20 % of the overall width of the Grid.
B. It defines five equally distributed grid column lines.
C. It defines four equally spaced grid clolumns.
D. It defines the maximum height and width of the Grid.
E. It defines the minimum height and width of the Grid.
Answer: A,E Explanation:

QUESTION NO: 23
You work as a Silverlight 4.0 developer for ABC.com. You are in the process of designing a Silverlight application named ABCApp.xap.
ABC.com has a Microsoft ASP.Net web page, named ABC.aspx. Also, two string variables exist, named xSt and ySt, which are currently handled by ABC.aspx.
You want to make sure that ABCApp.xap is hosted by ABC.aspx by using a HTML markup. This HTML markup should also allow for the two string variables to be sent to ABCApp.xap.
Which of the following code should be used?
A.


B.
C.
D.
Answer: A Explanation:

QUESTION NO: 24
You work as a Silverlight 4.0 developer for ABC.com. You are designing a Silverlight application named ABCApp21.
ABC.com has a web application, named ABCWeb, which has been configured to host ABCApp21. You have configured an XAML file, named TexABCing.xaml, in the ABCWeb application. The code used for this file is shown in the exhibit below:



ABCWeb also includes a Web page with the name of ABCdefault.aspx.
You want to make sure that, rather than the standard Silverlight application-loading page being presented, the TexABCing.xaml should be presented in its place. Furthermore, the progress of the loading process must be shown in percentage in the ABCLoad TextBlock.

Which of the following options describes the code that should be present in the ABCdefault.aspx?
A.
B.
C.


D.
Answer: B Explanation:

QUESTION NO: 25
You work as a Silverlight 4.0 developer for ABC.com. You are in the process of creating a Silverlight application named ABCApp3232.
ABC.com��s Web site contains a Web page named TestPage.aspx. ABCApp3232 is being hosted by TestPage.aspx.
You have configured a WCF service, which is hosted at the URL shown below:
http://www.acme.com/ABCService.svc

You have been informed that ABCApp32 should be the only Silverlight application to make use of ABCService.svc.
Which of the following actions should you take?
A. You should consider publishing a clientaccesspolicy.xml file in the http://www.acme.com root folder.
B. You should consider publishing a clientaccesspolicy.xml file in the http://www.ABC.com root folder.
C. You should consider publishing a servicepolicy.xml file file in the http://www.acme.com root folder.
D. You should consider publishing a servicepolicy.xml file file in the http://www ABC.com root folder.
Answer: A Explanation:

QUESTION NO: 26
You work as a Silverlight 4.0 developer for ABC.com.
There is a Silverlight application named ABCApp15.
ABCApp is hosted in the domain ABC.com.
There is a WCF server named AcmeService.
AcmeService is hosted in the domain acme.com.
When ABCApp15 connects to AcmeService, you are presented with the ��Page not found�� error message.
You have been instructed to rectify the problem. You want to start by adding a particular file to the Web host of Silverlight.
Which of the following options should you make use of?
A. A clientaccesspolicy.xml file.
B. A servicepolicy.xml file.
C. A clientaccesspolicy.xml resource file.
D. A servicepolicy.xml resource file.
Answer: A Explanation:



QUESTION NO: 27
You work as a Silverlight 4.0 developer for ABC.com.
You are currently in the process of creating a Silverlight application named ABCApp15, which is configured to be hosted by a web application ABCWeb.
ABCWeb is accessible via http://www.ABC.com.
ABCWeb includes many WCF services.
Some of these are available via the http://www.ABC.com/public URL, while others are available via http://www.ABC.com/local URL.
ABCApp should be able to use the services through http://www.ABC.com/local. Programmers outside the ABC company should be able to use the services through http://www.ABC.com/public.
You want to publish a clientaccesspolicy.xml file.
In which of the following locations should you publish the clientaccesspolicy.xml file?
A. In the root folder of http://www.ABC.com/public.
B. In the web.config file of ABCWeb.
C. In the root folder of http://www.ABC.com.
D. In the app.config file of ABCApp15.
E. In the root folder of http://www.ABC.com/local.
Answer: C Explanation:

QUESTION NO: 28
You work as a Silverlight 4.0 developer for ABC.com.
You are in the process of creating an application via Silverlight and MS .NET Framework 4. The application is named ABCApp13, and includes a page named ABCPage.

ABCPage has a button control and a TextBox control named ABCBC and ABCTB respectively. You have also defined a class, named ABCClass, within ABCPage. ABCClass facilitates the ICommand interface. ABCBC has ABCClass bound to it as a command.
You have received instructions to make sure that ABCTB acquires the ABCTB Text property as a parameter.
Which of the following actions should you take?
A. You should consider setting the command property of ABCBC to {Binding ElementName=ABCTB, Path=Text}
B. You should consider setting the command property of ABCTB to {Binding ElementName=ABCBC, Path=Text}
C. You should consider setting the property of ABCPage to {Binding ElementName=ABCTB, Path=Text}
D. You should consider setting the property of ABCPage to {Binding ElementName=ABCBC, Path=Text}
Answer: A Explanation:
QUESTION NO: 29
You work as a Silverlight 4.0 developer for ABC.com.
ABC.com has a Silverlight application named ABCApp that includes a page named ABCPage. You have configured a grid control for ABCPage, named ABCLayout.
You have received instructions to add a button to ABCLayout��s first column. Furthermore, you are required to meet the requirements shown below:
The ToolTip of this button must be set to Help is available.
The content of this button must be set to Help.
What should be done in this scenario?
A.


B.
C.
D.
You need to adequately complete the code.
Which of the llowing options should be used?
A. private void btnABC_Click(object sender, SourceChangedEventArgs e) { ABCCB.Text = Clipboard.GetText();}
B. private void btnABC_Click(object sender, ExceptionRoutedEventArgs e) { ABCCB.Text = Clipboard.GetText();}

C. private void btnABC_Click(object sender, RoutedEventArgs e) { ABCCB.Text = Clipboard.GetText();}
D. private void btnABC_Click(object sender, VisualStateChangedEventArgs e) { ABCCB.Text = Clipboard.GetText();}
Answer: C Explanation:

QUESTION NO: 38
You work as a Silverlight 4.0 developer for ABC.com.
You have developed a Silverlight application named ABCApp13, which has a custom control named ABCC configured.
You have adding a VisualState object ABCState in the Control Template to define visual conduct of ABCC.
You are required to create a segment that modifies the state of ABCC to ABCState.
Which of the following actions should you take?
A. You should make use of the segment below: VisualStateManager.GoToState(Me, "ABCState", True)
B. You should make use of the segment below: VisualStateManager.RaiseCurrentStateChanged(Me, "ABCState", True)
C. You should make use of the segment below: VisualStateManager.GetVisualStateGroups(Me, "ABCState", True)
D. You should make use of the segment below: VisualStateManager.GetCustomVisualStateManager(Me, "ABCState", True)
Answer: A Explanation:
QUESTION NO: 39
You work as a Silverlight 4.0 developer for ABC.com. You are currently creating a Silverlight application named ABCApp.

You have written the code shown below to host ABCApp:
type="application/x-silverlight-2" width="100%" height="100%">





" />

You need to fetch the content of the ModKey session variable. To do this you should make use of the Startup Event handler.
Which of the following actions should you take?
A. You should consider adding the code segment below to the App.xaml.cs file: private void Application_Startup(object sender, StartupEventArgs e) { var z = e.InitParams["ABCX"]; }
B. You should consider adding the code segment below to the App.xaml.cs file: private void Application_Startup(object sender, StartupEventArgs e) { var z = e.InitParams["ABCInit"]; }
C. You should consider adding the code segment below to the App.xaml.cs file: private void Application_Startup(object sender, StartupEventArgs e) { var z = e.InitParams["Session"]; }
D. You should consider adding the code segment below to the Web.config file: private void Application_Startup(object sender, StartupEventArgs e) {

var z = e.InitParams["ABCInit"]; }
Answer: B Explanation:

QUESTION NO: 40
You work as a Silverlight 4.0 developer for ABC.com. You are in the process of creating a Silverlight application named ABCApp, which is configured as an out-of-browser type application.
You need to make sure that ABCApp users always make use of the latest version of ABCApp. This functionality should be done automatically. The users should only be notified of the update of ABCApp.
You need to provide the necessary code.
Which of the following code fragments should be used?
A. public partial class ABCApp : Application { public ABCApp() { this.Startup += this.Application_Startup; InitializeComponent(); } void Application_Startup(object sender, StartupEventArgs e) { this.InstallState = new MainPage(); this.CheckAndDownloadUpdateAsync += (s, args) => { if (args.UpdateAvailable) { MessageBox.Show(��ABCApp has now been updated. To complete this process please restart ABCApp now.��); } }; this.CheckAndDownloadUpdateCompleted(); } }
B. public partial class ABCApp : Application {

public ABCApp() { this.Startup += this.Application_Startup; InitializeComponent(); } void Application (object sender, EventArgs e) { this.RootVisual = new MainPage(); this.CheckAndDownloadUpdateAsync += (s, args) => { if (args.UpdateAvailable) { MessageBox.Show(��ABCApp has now been updated. To complete this process please restart ABCApp now.��); } }; this.CheckAndDownloadUpdateCompleted(); } }
C. public partial class ABCApp : Application { public ABCApp() { this.Startup += this.Application_Startup; InitializeComponent(); } void Application_Startup(object sender, StartupEventArgs e) { this.RootVisual = new MainPage(); this.CheckAndDownloadUpdateCompleted += (s, args) => { if (args.UpdateAvailable) { MessageBox.Show(��ABCApp has now been updated. To complete this process please restart ABCApp now.��); } }; this.CheckAndDownloadUpdateAsync(); } }
D. public partial class ABCApp : Application { public ABCApp() { this.Startup += this.Application_Startup; InitializeComponent(); }

void Application_Startup(object sender, StartupEventArgs e) { this.InstallState = new MainPage(); this.CheckAndDownloadUpdateCompleted += (s, args) => { if (args.UpdateAvailable) { MessageBox.Show("ABCApp has now been updated. To complete this process please restart ABCApp now."); } }; this.CheckAndDownloadUpdateCompleted(); } }
Answer: C Explanation:

QUESTION NO: 41
You work as a Silverlight 4.0 developer for ABC.com.
You have received instruction to create a Silverlight application named ABCApp.
You have noticed that ABCApp is producing unhandled exceptions. You want to make sure that these exceptions do not end up at ABCApp��s hosting page.
Which of the following actions should you take?
A. You should consider writing the code shown below: public partial class ABCApp : Application { public ABCApp() { this.UnhandledException += this.AppUnhandledException; InitializeComponent(); }
B. ExceptionObject = Handled; } }
C. You should consider writing the code shown below: public partial class ABCApp : Application

{ public ABCApp() { this.UnhandledException += this.AppUnhandledException; InitializeComponent(); }
D. Handled = Null; } }
E. You should consider writing the code shown below: public partial class ABCApp : Application { public ABCApp() private void AppUnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) {
F. Handled = False; } }
G. You should consider writing the code shown below: public partial class ABCApp : Application { public ABCApp() { this.UnhandledException += this.AppUnhandledException; InitializeComponent(); } private void AppUnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) {
H. Handled = true; } }
Answer: D Explanation:


QUESTION NO: 42
You work as a Silverlight 4.0 developer for ABC.com.
There is a Silverlight application named ABCApp7m, which includes an Employee class. You have defined a public property, named IsOnDuty, within the Employee class. You have also set the data type for the public property as Boolean.
You are required to make sure that you have the ability to change this Boolean value to a button control Visibility property.

You have written the following code:
1.public class BoolToVisibilityConverter : IValueConverter
2.
3.bool result = System.Convert.ToBoolean(value);
4.return result ? Visibility.Visible : Visibility.Collapsed;
5.}
6.public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
7.{
8.
9.}
10.}
You are required to add the necessary code to line 2 and 8.
Which of the following actions should you take? (Choose two.)
A. Add the following code to line 2: Throw New NotImplementedException()
B. Add the following code to line 2: { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object _ Implements IValueConverter.Convert
C. Add the following code to line 8: Throw New NotImplementedException()
D. Add the following code to line 8: { public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object _ Implements

IValueConverter.Convert
Answer: B,C Explanation:
QUESTION NO: 43
You work as a Silverlight 4.0 developer for ABC.com. You are in the process of creating a Silverlight application named ABCApp22, which includes an XAML page named ABCPage.
You have also configured a Grid Control for the ABCPage, defined it as shown below:









You have also configured a user control with the type of ABCControl. You now want to change the content of second row of the Grid Control by making use of the user control.
Which of the following actions should you take?
A. You should add the code below to the code-behind file. public ABCPage() { InitializeComponent(); UserControl x = new ABCControl(); List remove = gridBody.Children.Where(c => c is FrameworkElement && Grid.GetRowSpan((FrameworkElement)c) == 1).ToList();

foreach (UIElement element in remove) { gridBody.Children.Remove(element); } Grid.SetRowSpan(x, 1) ;gridBody.Children.Add(x); }
B. You should add the code below to the code-behind file. public ABCPage() { InitializeComponent(); UserControl x = new ABCControl(); List remove = Children.Where(c => c is FrameworkElement && Grid.GetRowSpan((FrameworkElement)c) == 1).ToList(); foreach (UIElement element in remove) { Children.Remove(element); } Grid.SetRowSpan(x, 1) ;Children.Add(x); }
C. You should add the code below to the code-behind file. public ABCPage() { InitializeComponent(); UserControl x = new ABCControl(); List remove = gridBody.Where(c => c is FrameworkElement && Grid.GetRow((FrameworkElement)c) == 1).ToList(); foreach (UIElement element in remove) { gridBody.Remove(element); } Grid.SetRow(x, 1) ;gridBody.Add(x); }
D. You should add the code below to the code-behind file. public ABCPage() { InitializeComponent(); UserControl x = new ABCControl(); List remove = gridBody.Children.Where(c => c is FrameworkElement && Grid.GetRow((FrameworkElement)c) == 1).ToList(); foreach (UIElement element in remove) { gridBody.Children.Remove(element); } Grid.SetRow(x, 1)

;gridBody.Children.Add(x); }
Answer: D Explanation:

QUESTION NO: 44
You work as a Silverlight 4.0 developer for ABC.com.
ABC.com has a Silverlight application, named ABCApp21, which includes the XAML code shown below:

You are instructed to make sure that when one of the cars is selected, the content of the selected item should be displayed.
You start by writing the following code:
void ABCDisplayText(object sender, SelectionChangedEventArgs args){ ComboBoxItem x = ((sender as ComboBox).SelectedItem as ComboBoxItem); MessageBox.Show( "Item selected " + x.Content.ToString() + "."); }
Which of the foolowing actions should you take NEXT?
A. You should consider adding the code to the code-behind file.

B. You should consider adding the code to the App.config file.
C. You should consider adding the code to the Web.config file
D. You should consider removing the first two lines of the XAML code.
Answer: A Explanation:

QUESTION NO: 45
You work as a Silverlight 4.0 developer for ABC.com.
You have created a Silverlight application named ABCApp07, which is being hosted by a web application ABCWeb13. The ABCWeb13 root map stores a font named ABCFont in a file named ABCFont.otf. You have configured ABCApp07 to include a window named ABCWindow, which is configured to
include a TextBlock named ABCTB.
You need to make sure that the text in ABCTB is shown with ABCFont. Furthermore, you should make sure that ABCFont is accessed at runtime, not at compile time.
You have written the code shown below: (Line numbers are included for reference purposes.)
1.var client = new WebClient();
2. 3.{ 4.ABCTB.FontSource = new FontSource(args.Result); 5.ABCTB.FontFamily = new FontFamily("ABCFont"); 6.}; 7.client.OpenReadAsync(new Uri(@"../ABCFont.otf", UriKind.Relative));
Which of the following should be added at line 2?
A. ABCCl.WriteStreamClosed += (s, args) =>
B. ABCCl.OpenWriteCompleted += (s, args) =>
C. ABCCl.DownloadProgressChanged += (s, args) =>
D. ABCCl.OpenReadCompleted += (s, args) =>

Answer: D Explanation:

QUESTION NO: 46
You work as a Silverlight 4.0 developer for ABC.com. ABC.com has a Silverlight application named ABCApp15, which hosts a page named ABCPage.
Yo have configured ABCPage to include a user control, named ABC_KeyDown, which includes four text boxes named City, Region, Language, and Country. You have also defined a method named CityAndRegionKeyDown in the code-behind file of ABC_KeyDown.
You are preparing to add a method ABC_KeyDown that invokes this first method whenever the focus is on either the City TextBox control or on the Region TextBox control.
Which of the following actions should you take?
A. You should consider adding the code below to the code-behind file of ABC_KeyDown: private void ABC_KeyDown(object x, KeyEventArgs y) { if (((FrameworkElement)y.OriginalSource).Name == "City" || ((FrameworkElement)y.OriginalSource).Name == "Region") { CityAndRegionKeyDown(); }
B. Handled = true; } private void FirstAndLastNameKeyDown() { ... }
C. You should consider adding the code below to the code-behind file of ABC_KeyDown: private void ABC_KeyDown(object x, KeyEventArgs y) { if (((FrameworkElement)y.OriginalSource).Name == "City" || ((FrameworkElement)y.OriginalSource).Name == "Region") { CityAndRegionKeyDown(); }
D. Handled = false; } private void FirstAndLastNameKeyDown()

{ ... }
E. You should consider adding the code below to the App.config file: private void ABC_KeyDown(object x, KeyEventArgs y) { if (((FrameworkElement)y.OriginalSource).Name == "City" || ((FrameworkElement)y.OriginalSource).Name == "Region") { CityAndRegionKeyDown(); }
F. Handled = true; } private void FirstAndLastNameKeyDown() { ... }
G. You should consider adding the code below to the App.config file: private void ABC_KeyDown(object x, KeyEventArgs y) { if (((FrameworkElement)y.OriginalSource).Name == "City" || ((FrameworkElement)y.OriginalSource).Name == "Region") { CityAndRegionKeyDown(); }
H. Handled = false; } private void FirstAndLastNameKeyDown() { ... }
Answer: A Explanation:


QUESTION NO: 47
You work as a Silverlight 4.0 developer for ABC.com. You are currently designing a Silverlight application named ABCApp.
ABCApp contains a BackgroundWorker object, named ABCWK.

You are preparing to write code for ABCWK_DoWork. You start by writing the code shown below:
public MainPage()
{
InitializeComponent();
ABCWK.WorkerSupportsCancellation = true;
ABCWK.DoWork += new DoWorkEventHandler(ABCWK _DoWork);
ABCWK.RunWorkerCompleted += new RunWorkerCompletedEventHandler(ABCWK _Completed);
}
You are then informed that your code should allow for ABCWK to be cancelled.
Which of the following actions should you take?
A. You should add the code below to the end of the existing segment: private void ABCWK_DoWork(object z1, DoWorkEventArgs z2) {(int i = 0; i < 30; i++) { var x = (z1 as BackgroundABCWK); if(x) { z2.Cancel = false; break;} }
B. You should add the code below to the end of the existing segment: private void ABCWK_DoWork(object z1, DoWorkEventArgs z2) { var x = (z1 as BackgroundABCWK).CancellationPending; if(x) { z2.Cancel = false; break;} else { AprocessingStepThatTakesLongToExecute(); } }
C. You should add the code below to the end of the existing segment: private void ABCWK_DoWork(object z1, DoWorkEventArgs z2) {(int i = 0; i < 30; i++) { var x = (z1 as BackgroundABCWK).CancellationPending; if(x) { z2.Cancel = true;

break;} } }
D. You should add the code below to the end of the existing segment: private void ABCWK_DoWork(object z1, DoWorkEventArgs z2) {(int i = 0; i < 30; i++) { var x = (z1 as BackgroundABCWK).CancellationPending; if(x) { z2.Cancel = true; break;} else { AprocessingStepThatTakesLongToExecute(); } } }
Answer: D Explanation:
QUESTION NO: 48
You work as a Silverlight 4.0 developer for ABC.com. You have created a Silverlight application named ABCApp13.
You have been instructed to make sure that programmers at ABC.com are able to set a string named ABCHeading within the ABCControl. You, therefore, need to develop a dependency property named ABCHeadingProperty to facilitate the implementation. You also need to make sure that the ABCHeadingProperty is set to No Heading Available if it has not been assigned a value.
You are preparing to write the necessary code.
Which of the following options represent the suitable code?
A. public Class ABCControl : Control [ public string ABCHeading { public static readonly DependencyProperty ABCHeadingProperty = DependencyProperty.Register("ABCHeading", typeof(string), typeof(ABCControl), defaultMetadata("No Heading Available")) get { return (string) GetValue(ABCHeadingProperty), } Set { SetValue(ABCHeadingProperty, value) } } }

B. public Class ABCControl : Control [ public string ABCHeading { public static readonly DependencyProperty ABCHeadingProperty = DependencyProperty.GetMetadata ("ABCHeading", typeof(string), typeof(ABCControl), new PropertyMetadata("No Heading Available")) get { return (string) GetValue(ABCHeadingProperty), } Set { SetValue(ABCHeadingProperty, value) } } }
C. public Class ABCControl : Control [ public string ABCHeading { public static readonly DependencyProperty ABCHeadingProperty = DependencyProperty.Register("ABCHeading", typeof(string), typeof(ABCControl), new PropertyMetadata("No Heading Available")) get { return (string) GetValue(ABCHeadingProperty), } Set { SetValue(ABCHeadingProperty, value) } } }
D. public Class ABCControl : Control [ public string ABCHeading { public static readonly DependencyProperty ABCHeadingProperty = DependencyProperty.RegisterAttached("ABCHeading", typeof(string), typeof(ABCControl), new PropertyMetadata("No Heading Available")) get { return (string) GetValue(ABCHeadingProperty), } Set { SetValue(ABCHeadingProperty, value) } } }

Answer: D Explanation:
Topic 3, VB Questions

QUESTION NO: 49
You work as a Silverlight 4.0 developer for ABC.com. You are currently designing a Silverlight application named ABCApp.
ABCApp contains BackgroundWorker object, named ABCWK.
You are preparing to write code for ABCWK_DoWork. You start by writing the code shown below:
Public Sub New()
InitializeComponent()
ABCWK.ABCWKSupportsCancellation = True
AddHandler ABCWK.DoWork, New DoWorkEventHandler(AddressOf ABCWK_DoWork)
AddHandler ABCWK.RunABCWKCompleted, New RunABCWKCompletedEventHandler(AddressOf ABCWK_Completed)
End Sub
You are then informed that your code should allow for ABCWK to be cancelled.
Which of the following actions should you take?

A. You should add the code below to the end of the existing segment: Private ABCWK.DoWork(z As Object, z2 As DoWorkEventArgs) For i As Integer = 0 To 30 Dim cancel = TryCast(z,BackgroundABCWK).CancellationPending If x Then z2.Cancel = False End Sub
B. You should add the code below to the end of the existing segment: Private ABCWK.DoWork(z As Object, z2 As DoWorkEventArgs) Dim cancel = TryCast(z,BackgroundABCWK).CancellationPending If x Then z2.Cancel = False Else AprocessingStepThatTakesLongToExecute() End If Next End Sub
C. You should add the code below to the end of the existing segment: Private ABCWK.DoWork(z As Object, z2 As DoWorkEventArgs) For i As Integer = 0 To 30 Dim cancel = TryCast(z,BackgroundABCWK).CancellationPending If x Then z2.Cancel = True Next End Sub
D. You should add the code below to the end of the existing segment: Private ABCWK.DoWork(z As Object, z2 As DoWorkEventArgs) For i As Integer = 0 To 30 Dim cancel = TryCast(z,BackgroundABCWK).CancellationPending If x Then z2.Cancel = True Else AprocessingStepThatTakesLongToExecute() End If Next End Sub
Answer: D Explanation:


QUESTION NO: 50
You work as a Silverlight 4.0 developer for ABC.com. ABC.com has a Silverlight application named ABCApp15, which hosts a page named ABCPage.

Yo have configured ABCPage to include a user control, named ABC_KeyDown, which includes four text boxes named City, Region, Language, and Country. You have also defined a method named CityAndRegionKeyDown in the code-behind file of ABC_KeyDown.
You are preparing to add a method ABC_KeyDown that invokes this first method whenever the focus is on either the City TextBox control or on the Region TextBox control.
Which of the following actions should you take?
A. You should consider adding the code below to the code-behind file of ABC_KeyDown: Private Sub ABC_KeyDown(ByVal x As Object, ByVal y As KeyEventArgs) If ((CType(e.OriginalSource,FrameworkElement).Name = "City") _ OrElse (CType(e.OriginalSource,FrameworkElement).Name = "Region")) Then CityAndRegionKeyDown End If
B. Handled = true End Sub
C. You should consider adding the code below to the code-behind file of ABC_KeyDown: Private Sub ABC_KeyDown(ByVal x As Object, ByVal y As KeyEventArgs) If ((CType(e.OriginalSource,FrameworkElement).Name = "City") _ OrElse (CType(e.OriginalSource,FrameworkElement).Name = "Region")) Then CityAndRegionKeyDown End If
D. Handled = false End Sub
E. You should consider adding the code below to the App.config file: Private Sub ABC_KeyDown(ByVal x As Object, ByVal y As KeyEventArgs) If ((CType(e.OriginalSource,FrameworkElement).Name = "City") _ OrElse (CType(e.OriginalSource,FrameworkElement).Name = "Region")) Then CityAndRegionKeyDown End If
F. Handled = true End Sub
G. You should consider adding the code below to the App.config file: Private Sub ABC_KeyDown(ByVal x As Object, ByVal y As KeyEventArgs) If ((CType(e.OriginalSource,FrameworkElement).Name = "City") _ OrElse (CType(e.OriginalSource,FrameworkElement).Name = "Region")) Then CityAndRegionKeyDown End If
H. Handled = false End Sub
Answer: A Explanation: QUESTION NO: 51


You work as a Silverlight 4.0 developer for ABC.com. You have created a Silverlight application named ABCApp13.
You have been instructed to make sure that programmers at ABC.com are able to set a string named ABCHeading within the ABCControl. You, therefore, need to develop a dependency property named ABCHeadingProperty to facilitate the implementation. You also need to make sure that the ABCHeadingProperty is set to No Heading Available if it has not been assigned a value.
You are preparing to write the necessary code.
Which of the following options represent the suitable code?
A. Public Class ABCControl Inherits Control Public Shared ReadOnly ABCHeadingProperty As DependencyProperty = DependencyProperty.Register("ABCHeading", GetType(System.String), GetType(ABCControl), defaultMetadata("No Heading Available")) Public Property ABCHeading() As String Get Return DirectCast(GetValue(ABCHeadingProperty), String) End Get Set SetValue(ABCHeadingProperty, value) End Set End Property End Class
B. Public Class ABCControl Inherits Control Public Shared ReadOnly ABCHeadingProperty As DependencyProperty = DependencyProperty.GetMetadata("ABCHeading", GetType(System.String), GetType(ABCControl), New PropertyMetadata("No Heading Available")) Public Property ABCHeading() As String Get Return DirectCast(GetValue(ABCHeadingProperty), String) End Get Set SetValue(ABCHeadingProperty, value) End Set End Property End Class

C. Public Class ABCControl Inherits Control Public Shared ReadOnly ABCHeadingProperty As DependencyProperty = DependencyProperty.Register("ABCHeading", GetType(System.String), GetType(ABCControl), New PropertyMetadata("No Heading Available")) Public Property ABCHeading() As String Get Return DirectCast(GetValue(ABCHeadingProperty), String) End Get Set SetValue(ABCHeadingProperty, value) End Set End Property End Class
D. Public Class ABCControl Inherits Control Public Shared ReadOnly ABCHeadingProperty As DependencyProperty = DependencyProperty.RegisterAttached("ABCHeading", GetType(System.String), GetType(ABCControl), New PropertyMetadata("No Heading Available")) Public Property ABCHeading() As String Get Return DirectCast(GetValue(ABCHeadingProperty), String) End Get Set SetValue(ABCHeadingProperty, value) End Set End Property End Class
Answer: D Explanation:
QUESTION NO: 52
You work as a Silverlight 4.0 developer for ABC.com.
You are in the process of creating a Silverlight application named ABCApp22, which includes an XAML page named ABCPage. You have also configured a Grid Control for the ABCPage, defined it as shown below:









You have also configured a user control with the type of ABCControl. You now want to change the content of second row of the Grid Control with the user control.
Which of the following actions should you take?
A. You should add the code below to the code-behind file. Public Sub ABCPage() InitializeComponent() Dim x As UserControl = New MyCustomControl() gridBody.RowDefinitions.Remove( gridBody.RowDefinitions(1)) gridBody.Children.Insert(1, x) gridBody.Children.Clear()Grid.GetRowSpan(x, 1) gridBody.Children.Add(control) End Sub
B. You should add the code below to the code-behind file. Public Sub ABCPage() InitializeComponent() Dim x As UserControl = New MyCustomControl() RowDefinitions.Remove( RowDefinitions(1)) Children.Insert(1, x) Children.Clear()Grid.SetRowSpan(x, 1) Children.Add(control) End Sub
C. You should add the code below to the code-behind file. Public Sub ABCPage() InitializeComponent() Dim x As UserControl = New MyCustomControl() gridBody.RowDefinitions.Remove( gridBody.RowDefinitions(1)) gridBody.Insert(1, x) gridBody.Clear()Grid.SetRow(x, 1)

gridBody.Add(control) End Sub
D. You should add the code below to the code-behind file. Public Sub ABCPage() InitializeComponent() Dim x As UserControl = New MyCustomControl() gridBody.RowDefinitions.Remove( gridBody.RowDefinitions(1)) gridBody.Children.Insert(1, x) gridBody.Children.Clear()Grid.SetRow(x, 1) gridBody.Children.Add(control) End Sub
Answer: D Explanation:

QUESTION NO: 53
You work as a Silverlight 4.0 developer for ABC.com.
ABC.com has a Silverlight application, named ABCApp21, which includes the XAML code shown below:







You are instructed to make sure that when one of the cars is selected, the content of the selected item should be displayed.
You start by writing the following code:
Private Sub ABCDisplayText(sender As Object, args As SelectionChangedEventArgs)
Dim x As ComboBoxItem = TryCast(TryCast(sender, ComboBox).SelectedItem, ComboBoxItem) MessageBox.Show("Item selected " + x.Content.ToString() + ".")

End Sub
Which of the foolowing actions should you take NEXT?
A. You should consider adding the code to the code-behind file.
B. You should consider adding the code to the App.config file.
C. You should consider adding the code to the Web.config file
D. You should consider removing the first two lines of the XAML code.
Answer: A Explanation:

QUESTION NO: 54
You work as a Silverlight 4.0 developer for ABC.com.
You are in the process of creating a Silverlight application named ABCApp, which is is being hosted within a browser. You have configured ABCApp to include a TextBox named ABCCB. You have also configured security for ABCApp with a partial trust.
You are required to fetch the content of Windows clipboard. Furthermore, this data must be shown in the ABCAp textbox.
You start by writing the code shown below:

You need to adequately complete the code.
Which of the llowing options should be used?
A. Private Sub btnABC_Click(sender As Object, e As SourceChangedEventArgs) ABCCB.Text = Clipboard.GetText() End Sub
B. Private Sub btnABC_Click(sender As Object, e As ExceptionRoutedEventArgs) ABCCB.Text = Clipboard.GetText() End Sub
C. Private Sub btnABC_Click(sender As Object, e As RoutedEventArgs) ABCCB.Text =

Clipboard.GetText() End Sub
D. Private Sub btnABC_Click(sender As Object, e As VisualStateChangedEventArgs) ABCCB.Text = Clipboard.GetText() End Sub

Answer: C Explanation:


QUESTION NO: 55
You work as a Silverlight 4.0 developer for ABC.com.
You have recently created an application named ABCApp36. You are now prepairing to configure ABCApp36 to save a 12 MB file in an isolated storage.
After setting up ABCApp36 to make use of isolated storage, you find that the isolated storage is too small.
You have been instructed to write code that allows for the user of ABCApp36 to receive a notification to increase the available storage.
Which code should be used in this scenario?
A. Using x = IsolatedStorageFile.GetUserStoreForAssembly Method() Dim neededSpace = 12582912 If x.IncreaseQuotaTo(x.UsedSize + MemoryInNeed) Then ' ... End If End Using
B. Using x = IsolatedStorageFile.GetUserStoreForDomain Method() Dim neededSpace = 12582912 If x.IncreaseQuotaTo(x.UsedSize + MemoryInNeed) Then ' ... End If End Using
C. Using x = IsolatedStorageFile.GetMachineStoreForApplication Method() Dim neededSpace = 12582912 If x.IncreaseQuotaTo(x.UsedSize + MemoryInNeed) Then ' ...

End If End Using
D. Using x = IsolatedStorageFile.GetUserStoreForApplication() Dim neededSpace = 12582912 If x.IncreaseQuotaTo(x.UsedSize + MemoryInNeed) Then ' ... End If End Using
Answer: D Explanation:
QUESTION NO: 56
You work as a Silverlight 4.0 developer for ABC.com.
You have created an application named ABCApp13 that includes a listbox named ABCLB. Users must have the ability to print the items listed in
ABCLB.
After adding a button to the page, you are required to configure the button to provide the print functionality. You bind the ABCLB type to the PrintView UserControl, and have defined this PrintView to have the size of an A4 paper.
Which of the following options should you use?
A. Dim documentX = New PrintdocumentX () Dim ABCView = New PrintView() AddHandler documentX.PrintPage, Sub(s, args) Dim NumberOfItems = documentX.PrintedPageCount ABCView .DataContext = data args.PageVisual = ABCView If documentX.PrintedPageCount < Me.ABCLB.Items.Count - 0 Then args.HasNoMorePages = True End If End If End Sub documentX.Print("tickets")
B. Dim documentX = New PrintdocumentX () Dim ABCView = New PrintView() AddHandler documentX.PrintPage, Sub(s, args) Dim NumberOfItems = documentX.PrintedPageCount

If NumberOfItems < ABCLB.Items.Count Then Dim Y = ABCLB.Items(NumberOfItems) ABCView .DataContext = data args.PageVisual = ABCView If documentX.PrintedPageCount < Me.ABCLB.Items.Count - 1 Then args.HasMorePages = False End If End If End Sub documentX.Print("items")
C. Dim documentX = New PrintdocumentX () Dim ABCView = New PrintView() AddHandler documentX.PrintPage, Sub(s, args) Dim NumberOfItems = documentX.PrintedPageCount If NumberOfItems < ABCLB.Items.Count Then Dim Y = ABCLB.Items(NumberOfItems) ABCView .DataContext = data args.PageMargins = ABCView If documentX.PrintedPageCount < Me.ABCLB.Items.Count - 0 Then args.HasMorePages = True End If End If End Sub documentX.Print("items")
D. Dim documentX = New PrintdocumentX () Dim ABCView = New PrintView() AddHandler documentX.PrintPage, Sub(s, args) Dim NumberOfItems = ABCLB.Items.Count Then Dim Y = ABCLB.Items(NumberOfItems) ABCView .DataContext = data args.PrintableArea = ABCView If documentX.PrintedPageCount < Me.ABCLB.Items.Count - 0 Then args.HasMorePages = True End If End If End Sub documentX.Print("items")
Answer: C Explanation:


QUESTION NO: 57
You work as a Silverlight 4.0 developer for ABC.com. You are currently creating a Silverlight

application named ABCApp.
You have written the code shown below to host ABCApp:
type="application/x-silverlight-2" width="100%" height="100%">





" />

You need to fetch the content of the ModKey session variable. To do this you should make use of the Startup Event handler.
Which of the following actions should you take?
A. You should consider adding the code segment below to the App.xaml.cs file: Private Sub Application_Startup(sender As Object, e As StartupEventArgs) Dim moduleKey = e.InitParams("ABCX") End Sub
B. You should consider adding the code segment below to the App.xaml.cs file: Private Sub Application_Startup(sender As Object, e As StartupEventArgs) Dim moduleKey = e.InitParams("ABCInit") End Sub
C. You should consider adding the code segment below to the App.xaml.cs file: Private Sub Application_Startup(sender As Object, e As StartupEventArgs) Dim moduleKey = e.InitParams("Session") End Sub
D. You should consider adding the code segment below to the Web.config file: Private Sub Application_Startup(sender As Object, e As StartupEventArgs) Dim moduleKey = e.InitParams("ABCInit") End Sub
Answer: B Explanation: QUESTION NO: 58


You work as a Silverlight 4.0 developer for ABC.com.
You have received instruction to create a Silverlight application named ABCApp.
You have noticed that ABCApp is producing unhandled exceptions. You want to make sure that these exceptions do not end up at ABCApp��s hosting page.
Which of the following actions should you take?
A. You should consider writing the code shown below: Public Class App Inherits Application Public Sub ABCApp() AddHandler Me.UnhandledException, AddressOf Me.AppUnhandledException InitializeComponent End Sub
B. ExceptionObject = Handled End Sub End Class
C. You should consider writing the code shown below: Public Class App Inherits Application Public Sub ABCApp() AddHandler Me.UnhandledException, AddressOf Me.AppUnhandledException InitializeComponent End Sub )
D. Handled = Null End Sub End Class
E. You should consider writing the code shown below: Public Class App Inherits Application Public Sub ABCApp() AddHandler Me.UnhandledException, AddressOf Me.AppUnhandledException InitializeComponent End Sub
F. Handled = False End Sub End Class
G. You should consider writing the code shown below: Public Class App Inherits Application Public Sub ABCApp()

AddHandler Me.UnhandledException, AddressOf Me.AppUnhandledException InitializeComponent End Sub Private Sub AppUnhandledException(ByVal sender As Object, ByVal e As ApplicationUnhandledExceptionEventArgs)
H. Handled = true End Sub End Class
Answer: D Explanation:
QUESTION NO: 59
You work as a Silverlight 4.0 developer for ABC.com.
You are creating a Silverlight application named ABCApp7 that is configured as an out-of-browser application type. You have been instructed to make sure that ABCApp7 users always have the latest version of ABCApp7 available for use.
This functionality should be done automatically. The users should only be notified of the update of ABCApp7.
You are required to write the necessary code.
Which of the following options represents the ideal code?
A. Public Class App Inherits Application Public Sub New() AddHandler Me.Startup, AddressOf Me.Application_Startup InitializeComponent End Sub Private Sub Application_Startup(ByVal sender As Object, ByVal e As StartupEventArgs) Me.InstallState = New MainPage AddHandler Me.CheckAndDownloadUpdateAsync, Sub(s, args) If args.UpdateAvailable Then MessageBox.Show("TeABCingApp7 has now been updated. To complete this process please restart TeABCingApp7 now") End If End Sub Me.CheckAndDownloadUpdateCompleted() End Sub End Class

B. Public Class App Inherits Application Public Sub New() AddHandler Me.Startup, AddressOf Me.Application_Startup InitializeComponent End Sub Private Sub Application(ByVal sender As Object, ByVal e As EventArgs) Me.RootVisual = New MainPage AddHandler CheckAndDownloadUpdateAsync, Sub(s, args) If args.UpdateAvailable Then MessageBox.Show("TeABCingApp7 has now been updated. To complete this process please restart TeABCingApp7 now") End If End Sub Me.CheckAndDownloadUpdateCompleted() End Sub End Class
C. Public Class App Inherits Application Public Sub New() AddHandler Me.Startup, AddressOf Me.Application_Startup InitializeComponent End Sub Private Sub Application_Startup(ByVal sender As Object, ByVal e As StartupEventArgs) Me.RootVisual = New MainPage AddHandler Me.CheckAndDownload UpdateCompleted, Sub(s, args) If args.UpdateAvailable Then MessageBox.Show("TeABCingApp7 has now been updated. To complete this process please restart TeABCingApp7 now") End If End Sub Me.CheckAndDownloadUpdateAsync() End Sub End Class
D. Public Class App Inherits Application Public Sub New() AddHandler Me.Startup, AddressOf Me.Application_Startup InitializeComponent End Sub Private Sub Application_Startup(ByVal sender As Object, ByVal e As StartupEventArgs) Me.RootVisual = New MainPage AddHandler Me.CheckAndDownloadUpdateCompleted, Sub(s, args) If args.UpdateAvailable Then MessageBox.Show("TeABCingApp7 has now been updated. To complete this process please restart TeABCingApp7 now") End If End Sub Me.CheckAndDownloadUpdateCompleted()

End Sub End Class
Answer: C Explanation:

QUESTION NO: 60
You work as a Silverlight 4.0 developer for ABC.com.
There is a Silverlight application named ABCApp7, which includes an Employee class. You have defined a public property, named IsOnDuty, within the Employee class. You have also set the data type for the public property as Boolean.
You are required to make sure that you have the ability to change this Boolean value to a button control Visibility property.
You have written the following code:
1.Public Class BoolToVisibilityConverter 2.Implements IValueConverter
3. 4.Dim result As Boolean = System.Convert.ToBoolean(value) 5.Return If(result, Visibility.Visible, Visibility.Collapsed) 6.End Function 7.Public Function ConvertBack(value As Object, targetType As Type, 8.parameter As Object, culture As System.Globalization.CultureInfo) As Object _ Implements
IValueConverter.ConvertBack
9. 10.End Function 11.End Class
You are required to add the necessary code to line 3 and 9.

Which of the following actions should you take? (Choose two.)
A. Add the following code to line 3: Throw New NotImplementedException()
B. Add the following code to line 3: Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object _ Implements IValueConverter.Convert
C. Add the following code to line 9: Throw New NotImplementedException()
D. Add the following code to line 9: Public Function Convert(value As Object, targetType As Type, parameter As Object, culture As System.Globalization.CultureInfo) As Object _ Implements IValueConverter.Convert
Answer: B,C Explanation:

QUESTION NO: 61
You work as a Silverlight 4.0 developer for ABC.com.
You have created a Silverlight application named ABCApp07, which is being hosted by a web application ABCWeb13.
The ABCWeb13 root map stores a font named ABCFont in a file named ABCFont.otf.
You have configured ABCApp07 to include a window named ABCWindow, which is configured to include a TextBlock named ABCTB.
You need to make sure that the text in ABCTB is shown with ABCFont. Furthermore, you should make sure that ABCFont is accessed at runtime, not at compile time.
You have written the code shown below: (Line numbers are included for reference purposes.)
1.Dim ABCCl = New WebClient()
2.
3.ABCTB.FontSource = New FontSource(args.Result)
4.ABCTB.FontFamily = New FontFamily("ABCFont") 5.

6.End Sub
7.ABCCl.OpenReadAsync(New Uri("../ABCFont.otf", UriKind.Relative))
Which of the following should be added at line 2?
A. AddHandler ABCCl.WriteStreamClosed, Sub(s, args)
B. AddHandler ABCCl.OpenWriteCompleted, Sub(s, args)
C. AddHandler ABCCl.DownloadProgressChanged, Sub(s, args)
D. AddHandler ABCCl.OpenReadCompleted, Sub(s, args)
Answer: D Explanation:

QUESTION NO: 62
You work as a Silverlight 4.0 developer for ABC.com.
You have developed a Silverlight application named ABCApp13, which has a custom control named ABCC configured.
You have adding a VisualState object ABCState in the Control Template to define visual conduct of ABCC.
You are required to create a segment that modifies the state of ABCC to ABCState.
Which of the following actions should you take?
A. You should make use of the segment below: VisualStateManager.GoToState(Me, "ABCState", True)
B. You should make use of the segment below: VisualStateManager.RaiseCurrentStateChanged(Me, "ABCState", True)
C. You should make use of the segment below: VisualStateManager.GetVisualStateGroups(Me, "ABCState", True)
D. You should make use of the segment below: VisualStateManager.GetCustomVisualStateManager(Me, "ABCState", True)
Answer: A

Explanation: