Вы находитесь на странице: 1из 22

Scribd Upload Search Explore Documents Books - Fiction Books - Non-fiction Health & Medicine Brochures/Catalogs Government Docs

Docs How-To Guides/Manuals Magazines/Newspapers Recipes/Menus School Work + all categories Featured Recent People Authors Students Researchers Publishers Government & Nonprofits Businesses Musicians Artists & Designers Teachers + all categories Most Followed Popular Janak Makwana We're using Facebook to personalize your experience. Learn MoreDisable o View Public Profile o My Documents o My Collections o My Shelf o Messages o Notifications o Account o Help o Log Out Welcome to Scribd - Where the world comes to read, discover, and share... Were using Facebook to give you reading recommendations based on what your friend s are sharing and the things you like. We've also made it easy to connect with y our friends: you are now following your Facebook friends who are on Scribd, and they are following you! In the future you can access your account using your Fac ebook login and password. Learn moreNo thanks Some of your friends are already on Scribd:

Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 1 of 85 Question: 1. You are developing a Silverlight 4 application.The application defines the follo wing three event handlers. (Line numbers are included for reference only.)01 pri vate void HandleCheck(object sender, RoutedEventArgs e)02 {03 MessageBox.Show("C hecked");04 }0506 private void HandleUnchecked(object sender, RoutedEventArgs e) 07 {08 MessageBox.Show("Unchecked");09 }1011 private void HandleThirdState(objec t 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. Yo u alsoneed to ensure that the event handlers are invoked when the user changes t he state of thecontrol. Which XAML fragment should you use?A. <CheckBox x:Name=" cb2" Content="Three State CheckBox" IsChecked="True"Checked="Handle Check "Indet erminate = "Handle Unchecked" Unchecked = "HandleUnchecked" />B. <CheckBox x:Nam e="cb2" Content="Three State CheckBox" IsThreeState="True"Checked="HandleCheck" Indeterminate = "Handle Third State" Unchecked ="HandleUnchecked" />C. <CheckBox x:Name="cb2" Content="Three State Check Box" Is HitT est Visible ="True"Checked ="Handle Check" Indeterminate ="Handle Third State"Unchecked="HandleUnchecked" />D. <CheckBox x:Name="cb2" Content="Three State CheckBox" IsEnabled="True"Check ed="Handle Check" Indeterminate ="Handle Unchecked" Unchecked ="HandleUnchecked" /> Answer: BQuestion: 2. You are developing a Silverlight 4 application.The application contains an XAML page that defines the following Grid control.<Grid Name="gridBody" ><Grid.RowDef initions><RowDefinition /><RowDefinition /></Grid.RowDefinitions><TextBlock Text ="Employee Info" /><TextBlock Text="Please enter employee info" Grid.Row="1" Hei ght="20"VerticalAlignment="Top" /><TextBox x:Name="EmpInfo" Grid.Row="1" Margin= "0,25,0,0"TextWrapping="Wrap" /></Grid> The codebehindfile for myPage.xaml conta ins the following code segment. (Line numbers areincluded f or reference only.) Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 2 of 85 01 public myPage()02 {03 InitializeComponent();0405 UserControl control = new My CustomControl();0607 }You need to replace the contents of the second row of grid Body with a user control of the MyCustomControl type. Which code segment should you insert at line 06?A. gridBody.Children.Insert(1, control);B. gridBody.RowDef initions.Remove(gridBody.RowDefinitions[1]); gridBody.Children.Insert(1,control) ;C. gridBody.Children.Clear(); Grid.SetRow(control, 1); gridBody.Children.Add(co ntrol);D. List<UIElement> remove = gridBody.Children.Where(c => c is FrameworkEl ement &&Grid.GetRow((FrameworkElement)c) == 1).ToList(); foreach (UIElement elem ent inremove){gridBody.Children.Remove(element);}Grid.SetRow(control, 1);gridBod y.Children.Add(control); Answer: DQuestion: 3. You are developing a Silverlight 4 application. The application defines the foll owing XAMLfragment. (Line numbers are included for reference only.)01 <ComboBox> 02 <ComboBoxItem Content="Item 1" />03 <ComboBoxItem Content="Item 2" />04 <Comb oBoxItem Content="Item 3" />05 </ComboBox> The codebehindfile contains the follo wing code segment. (Line numbers are included for reference only.)06 void PrintT ext(object sender, SelectionChangedEventArgs args){0708 MessageBox.Show( "You se lected " + cbi.Content.ToString() + ".");09 }You need to ensure that when the us er selects an item in a ComboBox control, the content of t heitem is displayed. What should you do?A. Replace the following XAML fragment at line 01. <ComboBoxS electionChanged="PrintText"> Add the following code segment at line 07.ComboBoxI tem cbi = ((sender as ComboBox).SelectedItem as ComboBoxItem);B. Replace the fol

lowing XAML fragment at line 01. <ComboBoxSelectionChanged="PrintText"> Add the following code segment at line 07.ComboBoxItem cbi = ((sender as ComboBox).Selec tedIndex as ComboBoxItem);C. Replace the following XAML fragment at line 01. <Co mboBoxDropDownClosed="PrintText"> Add the following code segment at line 07.Comb oBoxItem cbi = ((sender as ComboBox).SelectedItem as ComboBoxItem);D. Replace th e following XAML fragment at line 01. <ComboBoxDropDownClosed="PrintText"> Add t he following code segment at line 07.ComboBoxItem cbi = ((sender as ComboBox).Se lectedIndex as ComboBoxItem); Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 3 of 85 Answer: AQuestion: 4. You are developing a Silverlight 4 application.You have a collection named ColPe ople of the List<Person> type. You define the Personclass according to the follo wing code segment.public class Person{public string Name {get; set;}public strin g Description { get; set; } public string Gender { get; set; } public int Age {g et; set; }public int Weight { get; set; }}You need to bind ColPeople to a ComboB ox so that only the Name property is displayed.Which XAML fragment should you us e?A. <ComboBox DataContext="{Binding ColPeople}" ItemsSource="{Binding ColPeople }"DisplayMemberPath="Name" />B. <ComboBox DataContext="{Binding Person}" ItemsSo urce="{Binding Person}"DisplayMemberPath="ColPeople" />C. <ComboBox DataContext= "{Binding ColPeople}" DisplayMemberPath="Name" />D. <ComboBox DataContext="{Bind ing Person}" /> Answer: AQuestion: 5. You are developing a Silverlight 4 application. You define an Invoice object acc ording to thefollowing code segment. Public class Invoice{public int InvoiceId { get; set; } public double Amount { get; set; } public SupplierSupplier { get; s et; }public DateTime InvoiceDate { get; set; } public DateTime PayDate { get; se t; } publicstring InvoiceDescription { get; set; }}You need to display a list of invoices that have the following properties displayed oneach line: InvoiceId, A mount, and InvoiceDate. Which XAML fragment should you use?A. <ListBox x:Name="I nvoiceListBox"><StackPanel Orientation="Horizontal"><TextBlock Text="{Binding Pa th=InvoiceId}" /><TextBlock Text="{Binding Path=Amount}" /><TextBlock Text="{Bin ding Path=InvoiceDate}" /></StackPanel></ListBox>B. <ListBox x:Name="InvoiceList Box"><StackPanel Orientation="Horizontal"><ListBoxItem><TextBlock Text="{Binding Path=InvoiceId}" /></ListBoxItem><ListBoxItem><TextBlock Text="{Binding Path=Am ount}" /></ListBoxItem><ListBoxItem> Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 4 of 85 <TextBlock Text="{Binding Path=InvoiceDate}" /></ListBoxItem></StackPanel></List Box>C. <ListBox x:Name="InvoiceListBox"><ListBox.Items><ItemsPanelTemplate><Stac kPanel Orientation="Horizontal"><TextBlock Text="{Binding Path=InvoiceId}" /><Te xtBlock Text="{Binding Path=Amount}" /><TextBlock Text="{Binding Path=InvoiceDat e}" /></StackPanel></ItemsPanelTemplate></ListBox.Items></ListBox>D. <ListBox x: Name="InvoiceListBox"><ListBox.ItemTemplate><DataTemplate><StackPanel Orientatio n="Horizontal"><TextBlock Text="{Binding Path=InvoiceId}" /><TextBlock Text="{Bi nding Path=Amount}" /><TextBlock Text="{Binding Path=InvoiceDate}" /></StackPane l></DataTemplate></ListBox.ItemTemplate></ListBox> Answer: DQuestion: 6. You are developing a Silverlight 4 application. You define the visual behavior o f a custom controlin the ControlTemplate by defining a VisualState object named Selected. You need to change thevisual state of the custom control to the select ed state. Which code segment or XAML fragmentshould you use?A. VisualStateManage r.GoToState( this, "Selected", true );B. <VisualTransition To="Selected"><Storyb oard></Storyboard></VisualTransition>C. <VisualTransition From="Selected"><Story board></Storyboard></VisualTransition>D. public static readonly DependencyProper ty SelectedProperty =DependencyProperty.Register("Selected", typeof(VisualState)

, typeof(MyControl), null);public VisualState Selected{get { return (VisualState )GetValue(SelectedProperty); }set { SetValue(SelectedProperty, value); }} Answer: A Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 5 of 85 Question: 7. You are developing an application by using Silverlight 4 and Microsoft .NET Fram ework4. You create a new user control in the application. You add the following XAML fragmentto the control.<StackPanel KeyDown="App_KeyDown" Orientation="Verti cal"><TextBox x:Name="firstName" /><TextBox x:Name="lastName" /><TextBox x:Name= "address" /></StackPanel>You add the following code segment in the code behindfi le of the control. (Line numbers are included for reference only.)01 private voi d App_KeyDown(object sender, KeyEventArgs e)02 {0304 }0506 private void FirstAnd LastNameKeyDown()07 {08 ...09 }You need to ensure that the First And LastName Ke yDown method is invoked when a keyis pressed while the focus is on the firstName or lastName TextBox controls. You also need toensure that the default behavior of the controls remains unchanged.Which code segment should you add at line 03?A . if (((FrameworkElement)sender).Name == "firstName" ||((FrameworkElement)sender ).Name == "lastName"){FirstAndLastNameKeyDown();}e.Handled = false;B. if (((Fram eworkElement)sender).Name == "firstName" ||((FrameworkElement)sender).Name == "l astName"){FirstAndLastNameKeyDown();}e.Handled = true;C. if (((FrameworkElement) e.OriginalSource).Name == "firstName" ||((FrameworkElement)e.OriginalSource).Nam e == "lastName"){FirstAndLastNameKeyDown();}e.Handled = false;D. if (((Framework Element)e.OriginalSource).Name == "firstName" ||((FrameworkElement)e.OriginalSou rce).Name == "lastName"){FirstAndLastNameKeyDown();}e.Handled = true; Answer: C Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 6 of 85 Question: 8. You are developing an application by using Silverlight 4 and Microsoft .NET Fram ework 4. Theapplication has a TextBox control named txtName. You need to handle the event when txtNamehas the focus and the user presses the F2 key. Which two a ctions should you perform? (Eachcorrect answer presents part of the solution. Ch oose two.)A. txtName.KeyDown += new KeyEventHandler(txtName_KeyDown);B. txtName. LostFocus += new RoutedEventHandler(txtName_LostFocus);C. txtName.TextChanged += new TextChangedEventHandler(txtName_TextChanged);D. void txtName_TextChanged(ob ject sender, TextChangedEventArgs e){if ((Key)e.OriginalSource == Key.F2){ //Cus tom logic}}E. void txtName_KeyDown(object sender, KeyEventArgs e){if (e.Key == K ey.F2){ //Custom logic}}F. void txtName_LostFocus(object sender, RoutedEventArgs e){if ((Key)e.OriginalSource == Key.F2){ //Custom logic} Answer: AEQuestion: 9. You are developing an application by using Silverlight 4 and Microsoft .NET Fram ework4. The application contains the following XAML fragment.<TextBlock x:Name=" QuoteOfTheDay" />The application calls a Windows Communication Foundation (WCF) service namedMyService t hat returnsthe quote of the day and assigns it to the Q uoteOfTheDay TextBlock.The application contains the following code segment. (Lin e numbers are included forreference only.)01 var client = new MyService.MyServic eClient();02 client.GetQuoteOfTheDayCompleted += (s, args) => QuoteOfTheDay.Text =args.Result;03 client.GetQuoteOfTheDayAsync();You need to handle errors that m ight occur as a result of the service call. You also needto provide a default va lue of "Unavailable" when an error occurs.Which code segment should you replace at lines 02 and 03?A. QuoteOfTheDay.Text = "Unavailable";client.GetQuoteOfTheDay Completed += (s, args) => QuoteOfTheDay.Text =args.Result;client.GetQuoteOfTheDa yAsync();B. client.GetQuoteOfTheDayCompleted += (s, args) =>{if (args.Result != null){ Exam Name:Microsoft Silverlight 4, DevelopmentExam Type:

MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 7 of 85 QuoteOfTheDay.Text = args.Result;}else{QuoteOfTheDay.Text = "Unavailable";}};cli ent.GetQuoteOfTheDayAsync();C. client.GetQuoteOfTheDayCompleted += (s, args) => QuoteOfTheDay.Text =args.Result;try{client.GetQuoteOfTheDayAsync();}catch (Excep tion ex){ // TODO: handle exceptionQuoteOfTheDay.Text = "Unavailable";}D. client .GetQuoteOfTheDayCompleted += (s, args) =>{if (args.Error == null){QuoteOfTheDay .Text = args.Result;}else{ // TODO: handle errorQuoteOfTheDay.Text = "Unavailabl e";}};client.GetQuoteOfTheDayAsync(); Answer: DQuestion: 10. You are developing an application by using Silverlight 4 and Microsoft .NET Fram ework4.You create a Windows Communication Foundation (WCF) Data Service. You add aservice reference to the WCF Data Service named NorthwindEntities in theSilver light application. You also add a CollectionViewSource object namedordersViewSou rce in the Silverlight application.You add the following code segment. (Line num bers are included for reference only.)01 void getOrders_Click(object sender, Rou tedEventArgs e)02 {03 var context = new NorthwindEntities();0405 var query = fro m order in context.Orders06 select order;0708 }You need to retrieve the Orders d ata from the WCF Data Service and bind the data to theordersViewSource object.Wh ich two actions should you perform? Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 8 of 85 (Each correct answer presents part of the solution. Choose two.)A. Add the follo wing code segment at line 04.var obsCollection = new ObservableCollection<Order> ();B. Add the following code segment at line 04.var dsOrders = new DataServiceCo llection<Order>();dsOrders.LoadCompleted += new EventHandler<LoadCompletedEventA rgs>((dsc, args) =>{});ordersViewSource.Source = dsOrders;C. Add the following c ode segment at line 07. dsOrders.LoadAsync(query);D. Add the following code segm ent at line 07. dsOrders.Load(query);E. Add the following code segment at line 0 7. query.ToList().ForEach(o =>obsCollection.Add(o)); ordersViewSource.Source = o bsCollection; Answer: BCQuestion: 11. You are developing an application by using Silverlight 4 and Microsoft .NET Fram ework4. You add a BackgroundWorker object named worker to the application.You ad d the following code segment. (Line numbers are included for reference only.)01 public MainPage()02 {03 InitializeComponent();04 worker.WorkerSupportsCancellati on = true;05 worker.DoWork += new DoWorkEventHandler(worker_DoWork);06worker.Run WorkerCompleted += newRunWorkerCompletedEventHandler(worker_Completed)07 }08 pri vate void worker_DoWork(object sender, DoWorkEventArgs e)09 {10 for (int i = 0; i < 100; i++) {11 InvokeLongRunningProcessStep();12 }13 }You need to ensure that worker can be properly canceled. Which code segment shouldyou use to replace li ne 11?A. var cancel = (sender as BackgroundWorker).CancellationPending;if(cancel ) {(sender as BackgroundWorker).CancelAsync();break;}else { InvokeLongRunningPro cessStep();}B. var cancel = (sender as BackgroundWorker).CancellationPending;if( cancel) { e.Cancel = true; break;}else { InvokeLongRunningProcessStep();}C. var cancel = e.Cancel; Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 9 of 85 if(cancel) {(sender as BackgroundWorker).CancelAsync();break;}else { InvokeLongR unningProcessStep();}D. var cancel = e.Cancel;if(cancel) { e.Cancel = true; brea k;}else { InvokeLongRunningProcessStep();} Answer: BQuestion: 12. You are developing an application by using Silverlight 4 and Microsoft .NET Fram ework4.You add a BackgroundWorker object named worker to the application. You al so add aCheckB ox control named checkBox and a TextBlock control named statusTex

tBlock.You add the follo wing code segment. (Line numbers are included for refer ence only.)01 public MainPage()02 {03 InitializeComponent();04 worker.WorkerRepo rtsProgress = true;05 worker.DoWork += new DoWorkEventHandler(worker_DoWork);06w orker.ProgressChanged += newProgressChangedEventHandler(worker_ProgressChanged); 07 }08 private void worker_DoWork(object sender, DoWorkEventArgs e)09 {10 for (i nt i = 0; i < 100; i++) {11 bool isChecked = checkBox.IsChecked.HasValue &&check Box.IsChecked.Value;12 ExecuteLongRunningProcessStep(isChecked);13 worker.Report Progress(i);14 }15 }16 private void worker_ProgressChanged(object sender, Progre ssChangedEventArgse)17 {18 statusTextBlock.Text = e.ProgressPercentage + "%";19 }You attempt to run the application. You receive the following error message:"In valid crossthread acce ss."You need to ensure that worker executes successfully. What should you do?A. Replace line 11 with the following code segment.var b = ( bool )checkBox.GetValue(CheckBox.IsCheckedProperty);bool isChecked = b.HasValue && b.Value;B. Replace line 11 with the following code segment. bool isChecked = false;Dispatcher.BeginInvoke(() =>{});isChecked = checkBox.IsChecked.HasValue && checkBox.IsChecked.Value; Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 10 of 85 C. Replace line 18 with the following code segment.statusTextBlock.SetValue(Text Block.TextProperty, e.ProgressPercentage + "%");D. Replace line 18 with the foll owing code segment.Dispatcher.BeginInvoke(() =>{});statusTextBlock.Text = e.Prog ressPercentage + "%"; Answer: BQuestion: 13. You are developing an application by using Silverlight 4 and Microsoft .NET Fram ework4. You add the following code segment. (Line numbers are included for refer ence only.)01 public class MyControl : Control02 {0304 public string Title05 {06 get { return (string)GetValue(TitleProperty); }07 set { SetValue(TitleProperty, value); }08 }09 }You need to create a dependency property named TitleProperty t hat allows developers toset th e Title. You also need to ensure that the default value of the TitlePropertydependency property is set to Untitled. Which code se gment you add at line 03?A. public static readonly DependencyProperty TitlePrope rty =DependencyProperty.Register("Untitled",typeof(string), typeof(MyControl), n ull);B. public static readonly DependencyProperty TitleProperty =DependencyPrope rty.Register("Untitled",typeof(string), typeof(MyControl),new PropertyMetadata(" Title"));C. public static readonly DependencyProperty TitleProperty =DependencyP roperty.Register("Title",typeof(string), typeof(MyControl),new PropertyMetadata( "Untitled"));D. public static readonly DependencyProperty TitleProperty =Depende ncyProperty.Register("Title",typeof(string), typeof(MyControl),new PropertyMetad ata(new PropertyChangedCallback((depObj, args) =>{depObj.SetValue(MyControl.Titl eProperty, "Untitled");}))); Answer: CQuestion: 14. You are developing an application by using Silverlight 4 and Microsoft .NET Fram ework4.You create a control named MyControl in the application. Each instance of thecontrol contains a list of FrameworkElement objects.You add the following co de segment. (Line numbers are included for reference only.)01 public class MyCon trol : Control02 { Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 11 of 85 0304 public List<FrameworkElement> ChildElements05 {06 get {07 return List<Frame workElement>)GetValue(MyControl.ChildElementsProperty);08 }09 }1011 public MyCon trol()12 {1314 }15 static MyControl()16 {1718 }19 }You need to create the ChildE lementsProperty dependency property. You also need toinitialize the property by using an empty list of FrameworkElement objects.Which two actions should you per form?(Each correct answer presents part of the solution. Choose two.)A. Add the following code segment at line 03.public static readonly DependencyProperty Chil dElementsProperty =DependencyProperty.Register("ChildElements", typeof(List<Fram

eworkElement>),typeof(My Control),new PropertyMetadata(new List<FrameworkElement >()));B. Add the following code segment at line 03.public static readonly Depend encyProperty ChildElementsProperty =DependencyProperty.Register("ChildElements", typeof(List<FrameworkElement>),typeof(My Control),new PropertyMetadata(null));C . Add the following code segment at line 13.SetValue(MyControl.ChildElementsProp erty, new List<FrameworkElement>());D. Add the following code segment at line 17 .ChildElementsProperty =DependencyProperty.Register("ChildElements", typeof(List <FrameworkElement>),typeof(MyControl),new PropertyMetadata(new List<FrameworkEle ment>())); Answer: BCQuestion: 15. You are developing an application by using Silverlight 4 and Microsoft .NET Fram ework4. You add the following code segment. (Line numbers are included for refer ence only.)01 var outerCanvas = new Canvas();02 var innerCanvas = new Canvas();0 3 innerCanvas.Width = 200;04 innerCanvas.Height = 200;05 outerCanvas.Children.Ad d(innerCanvas);06You need to set the distance between the left of the innerCanva s element and the left ofthe out erCanvas element to 150 pixels. Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 12 of 85 Which code segment should you add at line 06?A. outerCanvas.Margin = new Thickne ss(0.0, 150.0, 0.0, 0.0);B. innerCanvas.Margin = new Thickness(0.0, 150.0, 0.0, 0.0);C. outerCanvas.SetValue(Canvas.LeftProperty, 150.0);D. innerCanvas.SetValue (Canvas.LeftProperty, 150.0); Answer: DQuestion: 16. You are developing a Silverlight 4 application. The application contains a Produ ct class that has apublicBoolean property named IsAvailable.You need to create a value converter that binds data to the Visibility property of a Button controlW hich code segment should you use?A. public class BoolToVisibilityConverter : IVa lueConverter{public object Convert(object value, Type targetType, object paramet er,System.Globalization. CultureInfoculture){bool result = System.Convert.ToBool ean(parameter);return result Visibility.Visible : Visibility.Collapsed;}public o bject ConvertBack(object value, Type targetType, object parameter,System.Globali zation.CultureInfo culture){throw new NotImplementedException();}}B. public clas s BoolToVisibilityConverter : IValueConverter{public object Convert(object value , Type targetType, object parameter,System.Globalization. CultureInfoculture){bo ol result = System.Convert.ToBoolean(value);return result Visibility.Visible : V isibility.Collapsed;}public object ConvertBack(object value, Type targetType, ob ject parameter,System.Globalization.CultureInfo culture){throw new NotImplemente dException();}}C. public class BoolToVisibilityConverter : PropertyPathConverter {public object Convert(object value, Type targetType, object parameter,System.Gl obalization. CultureInfoculture){return this.ConvertTo(value, typeof(Visibility) );}public object ConvertBack(object value, Type targetType, object parameter,Sys tem.Globalization.CultureInfo culture){throw new NotImplementedException(); Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 13 of 85 }}D. public class BoolToVisibilityConverter{public object Convert(object value, Type targetType, object parameter,System.Globalization. CultureInfoculture){bool result = System.Convert.ToBoolean(value);return result Visibility. Visible : Vi sibility. Collapsed;}public object ConvertBack(object value, Type targetType, ob ject parameter,System.Globalization.CultureInfo culture){throw new NotImplemente dException();}} Answer: BQuestion: 17. You are developing a Silverlight 4 application. The application contains a Produ ct classthat has a public string property named Name.You create a TextBox contro l by using the following XAML fragment.<TextBox Text="{Binding Name, ValidatesOn DataErrors=True}" />You need to ensure that validation errors are reported to th e user interface. You also needto ensure that a validation error will occur when

the TextBox control is empty.Which code segment should you use?A. public class Product{[Required()]public string Name { get; set; }}B. public class Product : I DataErrorInfo{public string Name { get; set; }public string Error { get { return null; } }public string this[string columnName]{get{if (columnName == "Name" && string.IsNullOrEmpty(Name)){throw new ValidationException("Name should not be em pty! ");}return string.Empty;}}}C. public class Product : IDataErrorInfo{public string Name { get; set; }public string Error { get { return null; } }public stri ng this[string columnName]{get{ Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 14 of 85 if (columnName == "Name" && string.IsNullOrEmpty(Name)){return "Name should not be empty!";}return string.Empty;}}}D. public class Product{private string _name; public string Name{get { return _name; }set{if (string.IsNullOrEmpty(value))thro w new ValidationException("Name should not be empty! "); _name = value;}}} Answer: CQuestion: 18. You are developing a ticketing application by using Silverlight 4. You have a li stbox namedlstTickets that contains a list of the tickets. The page contains a b utton that allows the user toprint t he tickets. The PrintView UserControl binds to the type in lstTickets and is designed to fit astandard sheet of paper. You add the following code segment to the button event handler. (Linenumbers are inc luded for reference only.)01 var doc = new PrintDocument();02 var view = new Pri ntView();03 doc.PrintPage += (s, args) =>04 {05 var ppc = doc.PrintedPageCount;0 6 if (ppc < lstTickets.Items.Count)07 {08 var data = lstTickets.Items[ppc];09 vi ew.DataContext = data;10 args.PageVisual = view;111213 }14 };15 doc.Print("ticke ts");You need to use the Silverlight printing API to print each ticket on its ow n page. You also need t oensure that all tickets in the listbox are printed.Whic h code segment should you insert at lines 11 and 12?A. if (args.HasMorePages == false)return;B. if (args.HasMorePages == true) return;C. if (doc.PrintedPageCoun t < this.lstTickets.Items.Count 1)args.HasMorePages = true;D. if (ppc == this.ls tTickets.Items.Count 1)doc.EndPrint += (o, p) => { return; }; Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 15 of 85 Answer: CQuestion: 19. You are developing an outofbrowser application by using Silverlight 4. The main page ofthe application contains the following code segment. public MainPage(){In itializeComponent();Network Change .Network Address Changed += (s, e) => Check N etwork Status AndRaise Toast(); Check Network Status And Raise Toast();}You need to ensure that the application will raise a toast notification when networkconn ectivity changes. Which two actions should you perform in theCheckNetworkStatusA ndRaiseToast me thod? (Each correct answer presents part of thesolution. Choose two.)A. Verify that App.Current.IsRunningOutOfBrowser is true.B. Verify that App .Current.IsRunningOutOfBrowser is false.C. Verify that App.Current.HasElevatedPe rmissions is true.D. Verify that App.Current.HasElevatedPermissions is false.E. Examine NetworkInterface.GetIsNetworkAvailable().F. Call App.Current.CheckAndDow nloadUpdateAsync() in a try/catch block. Answer: AEQuestion: 20. You have a Silverlight 4 application that uses isolated storage. You create an a pplicationthat 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 s torageallocation. You also need to ensure that only the minimum amount of space needed to save the 5MB file is requested.Which code segment should you use?A. us ing (var store = IsolatedStorageFile.GetUserStoreForApplication()){var neededSpa ce = 5242880;if (store.IncreaseQuotaTo(neededSpace)){}}B. using (var store = Iso latedStorageFile.GetUserStoreForApplication()){var neededSpace = 5242880;if (sto re.IncreaseQuotaTo(store.Quota + neededSpace)){}}C. using (var store = IsolatedS

torageFile.GetUserStoreForApplication()){var neededSpace = 5242880;if (store.Inc reaseQuotaTo(store.AvailableFreeSpace + neededSpace)){}}D. using (var store = Is olatedStorageFile.GetUserStoreForApplication()){ Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 16 of 85 var neededSpace = 5242880;if (store.IncreaseQuotaTo(store.UsedSize + neededSpace )){}} Answer: DQuestion: 21. You are developing a shopping application by using Silverlight 4. The applicatio n has aListBox named lstBasket that contains the items in the shopping basket. Y ou need to savethe items in l stBasket to isolated storage. You also need to ens ure that the items isolatedstorage are available to other Silverlight applicatio ns hosted on the same Web site.Which code segment should you use?A. var settings = IsolatedStorageSettings.ApplicationSettings;var items = this.lstBasket.DataCo ntext;var token = "basket";if (settings.Contains(token))settings[token] = items; elsesettings.Add(token, items);B. var store = IsolatedStorageFile.GetUserStoreFo rApplication();var fileName = "basket.dat";var items = this.lstBasket.DataContex t;using (var fs = new IsolatedStorageFileStream(fileName, FileMode.Create,FileAc cess.Write, st ore)){var serializer = new DataContractSerializer(items.GetType() );serializer.WriteObject(fs, items);}store.CreateFile(fileName);C. var settings = IsolatedStorageSettings.SiteSettings;var items = this.lstBasket.DataContext;va r token = "basket";if (settings.Contains(token))settings[token] = items;elsesett ings.Add(token, items);D. var store = IsolatedStorageFile. GetUserStoreForSite() ;var fileName = "basket.dat";var items = this.lstBasket.DataContext;using (var f s = new IsolatedStorageFileStream(fileName, FileMode.Create,FileAccess.Write, st ore)){var serializer = new DataContractSerializer(items.GetType());serializer.W riteObject(fs, items);}store.CreateFile(fileName); Answer: C Question: 22. You are developing a Silverlight 4 application. The Web page of the application containsa Text Box that has the txtTime ID. You define the following JavaScript function on the Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 17 of 85 Web page. function ShowTime(strTime) {document.getElementById('txtTime').value = strTime;}You need to pass the current time to the ShowTime function from Silver light. Which codesegment should you use?A. HtmlPage.Window.Invoke("ShowTime", Da teTime.Now.ToString());B. HtmlPage.Window.InvokeSelf("ShowTime(" + DateTime.Now. ToString() + ")");C. HtmlPage.Window.Invoke("ShowTime(" + DateTime.Now.ToString( ) + ")", null);D. HtmlPage.Window.InvokeSelf("javascript: ShowTime(" + DateTime. Now.ToString() + ")"); Answer: AQuestion: 23. You are developing a browser hosted application by using Silverlight 4. The appl ication runs inpartial trust and uses the copy and paste functionality.The appli cation contains the following XAML fragment.<TextBox x:Name="textBoxClipBoard" / >You need to retrieve the contents of the Clipboard and display the contents in theTextBox. Which XAML fragment or code segment should you use?A. public MainPag e(){InitializeComponent();textBoxClipBoard.Text = Clipboard.GetText();}B. public MainPage(){InitializeComponent();this.Loaded += new RoutedEventHandler(MainPage _Loaded);}void MainPage_Loaded(object sender, RoutedEventArgs e){textboxClipboar d.Text = Clipboard.GetText();}C. <Button x:Name="btnGetClipboard" Content="Get C lipboard"Click="btnGetClipboard_Click"></Button>private void btnGetClipboard_Cli ck(object sender, RoutedEventArgs e){textboxClipboard.Text = Clipboard.GetText() ;}D. <Button x:Name="btnGetClipboard" Content="Get Clipboard"Click="btnGetClipbo ard_Click"></Button>private void btnGetClipboard_Click(object sender, RoutedEven tArgs e){Clipboard.SetText(textboxClipboard.Text);}

Answer: CQuestion: 24. You are developing a Silverlight 4 application. The application has a user contr ol namedHomePage.xaml and an Application class named App.xaml. Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 18 of 85 HomePage.xaml must be displayed when the application is started. You need to set HomePage.xaml as the initial page of the application. What should you do?A. Crea te the following constructor for the Application class. public App(){InitializeC omponent();var homePage = new HomePage();homePage.Visibility = Visibility.Visibl e;}B. Create the following constructor for the Application class. public App(){I nitializeComponent();this.MainWindow.SetValue(UserControl.ContentProperty, new H omePage());}C. Create the following event handler for the Application.Startup ev ent. private voidApplication_Startup(object sender, StartupEventArgs e){this.Roo tVisual = new HomePage();}D. Create the following event handler for the Applicat ion.Startup event. private voidApplication_Startup(object sender, StartupEventAr gs e){var homePage = new HomePage(); homePage.SetValue(HomePage.ContentProperty, this.MainWindow); this.MainWindow.Activate();} Answer: CQuestion: 25. You are developing a Silverlight 4 application. The application contains the fol lowing codesegment. (Line numbers are included for reference only.)01 public par tial class App : Application02 {03 public App()04 {05 this.UnhandledException += this.AppUnhandledException;06 InitializeComponent();07 }0809private void AppUnh andledException(object sender,ApplicationUnhandledExceptionEventArgs e)10 {1112 }13 }You need to ensure that unhandled exceptions in the application are prevent ed from being thrownto the page that hosts the application. Which code segment s hould you insert at line 11?A. ((SystemException)sender).Data.Clear();B. e.Excep tionObject = null;C. e.Handled = false;D. e.Handled = true; Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 19 of 85 Answer: DQuestion: 26. You are developing an outofbrowser application by using Silverlight 4. The appli cation containsthe following code segment. (Line numbers are included for refere nce only.)01 public partial class App : Application02 {03 public App()04 {05 thi s.Startup += this.Application_Startup;06 InitializeComponent();07 }08 void Appli cation_Startup(object sender, StartupEventArgs e)09 {10 this.RootVisual = new Ma inPage();1112 }13 }You need to ensure that when a new version of the application is available, it is automatically installed and the user is notified.Which code segment should you insert at line 11?A. if (this.Install()){MessageBox.Show("Ne wer version is installed. Please restart the application");}B. this.InstallState Changed += (s, args) =>{if (this.InstallState == InstallState.Installed){Message Box.Show("Newer version is installed. Please restart the application");}};this.I nstall();C. this.CheckAndDownloadUpdateCompleted += (s, args) =>{if (args.Update Available){MessageBox.Show("Newer version is installed. Please restart the appli cation");}};this.CheckAndDownloadUpdateAsync();D. this.CheckAndDownloadUpdateCom pleted += (s, args) =>{if (this.IsRunningOutOfBrowser){MessageBox.Show("Newer ve rsion is installed. Please restart the application");}};this.CheckAndDownloadUpd ateAsync(); Answer: C Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 20 of 85 Question: 27. You are developing a Silverlight 4 application. The application is hosted by usi ng the FollowingHTML element.<object data="data:application/xsilverlight2,"type= "application/xsilverlight2" width="100%" height="100%"><param name="source" valu

e="ClientBin/MyApp.xap"/><param name="onError" value="onSilverlightError" /><par am name="background" value="white" /><param name="minRuntimeVersion" value="4.0. 50401.0" /><param name="autoUpgrade" value="true" /><param name="initParams" val ue="InitKey=<%=Session["modKey"] %>" /></object>The App.xaml.cs file contains th e following code segment. (Line numbers are includedfor refer ence only.)01 priv ate void Application_Startup(object sender, StartupEventArgs e)02 {0304 }You nee d to retrieve the value of the modKey session variable in the Startup event hand ler.Which code segment should you insert at line 03?A. var moduleKey = e.InitPar ams["modKey"];B. var moduleKey = e.InitParams["InitKey"];C. var moduleKey = e.In itParams.Select(kvp => kvp.Key == "modKey").ToString();D. var moduleKey = e.Init Params.Select(kvp => kvp.Key == "InitKey").ToString(); Answer: BQuestion: 28. You are developing a Silverlight 4 application. You plan to host the application in a Webapplication. The Web application contains a zip file named Images.zip t hat contains an imagenamed l ogo.jpg. You write the following code segment.WebCl ient client = new WebClient();client.OpenReadCompleted += newOpenReadCompletedEv entHandler(ClientOpenReadComp leted);client.OpenReadAsync(new Uri(@"..\Images.zi p",UriKind.Relative));You also write the following event handler. (Line numbers are included for reference only.)01 void client_OpenReadCompleted(object sender, 02 OpenReadCompletedEventArgs e)03 {04if (e.Error == null && !e.Cancelled)05 {06 07 }08 }The main window contains an Image element named ImgLogo.You need to extr act logo.jpg from Images.zip and set logo.jpg as the source for ImgLogo.Which co de segment should you insert at line 06?A. var zipResource = new StreamResourceI nfo(e.Result, @"application/zip");var imageSource = Application.GetResourceStrea m(zipResource, newUri("Logo.jpg",UriKind.A Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 21 of 85 bsolute));BitmapImage image = new BitmapImage(); image.SetSource(imageSource.Str eam);ImgLogo.Source=image;B. var zipResource = new StreamResourceInfo(e.Result, @"application/zip");var imageSource = Application.GetResourceStream(zipResource, new Uri("Logo.jpg",UriKind. Relative));BitmapImage image = new BitmapImage(); i mage.SetSource(imageSource.Stream);ImgLogo.Source=image;C. var imageSource = new StreamResourceInfo(e.Result, "./Logo.jpg"); BitmapImageimage = new BitmapImage( ); image.SetSource(imageSource.Stream);ImgLogo.Source = image;D. var imageSource = new StreamResourceInfo(e.Result, "Images/Logo.jpg");BitmapImage image = new B itmapImage(); image.SetSource(imageSource.Stream);ImgLogo.Source = image; Answer: BQuestion: 29. You are developing a Silverlight 4 application. The application contains a windo w that has a TextBlock named TxtHeading. The application also has a font named M yFont in a file named MyFont.otf. MyFont.otf is located in the root folder of th e Web application that hosts the Silverlight application. You need to dynamicall y load the font file and use it to display the contents ofTxtHeading. Which code segment should you write in the load event of the window?A. var client = new We bClient();client.DownloadStringCompleted += (s, args) =>{TxtHeading.FontFamily = new FontFamily(args.Result);;}client.DownloadStringAsync(new Uri(@"..\MyFont.ot f", UriKind.Absolute));B. var client = new WebClient();client.DownloadStringComp leted += (s, args) =>{TxtHeading.FontFamily = new FontFamily(args.Result);;}clie nt.DownloadStringAsync(new Uri(@"..\MyFont.otf", UriKind.Relative));C. var clien t = new WebClient();client.OpenReadCompleted += (s, args) =>{TxtHeading.FontSour ce = new FontSource(args.Result); TxtHeading.FontFamily = newFontFamily("MyFont" );;}client.OpenReadAsync(new Uri(@"..\MyFont.otf", UriKind.Absolute));D. var cli ent = new WebClient();client.OpenReadCompleted += (s, args) =>{TxtHeading.FontSo urce = new FontSource(args.Result); TxtHeading.FontFamily = newFontFamily("MyFon t");;}client.OpenReadAsync(new Uri(@"..\MyFont.otf", UriKind.Relative)); Answer: DQuestion: 30. You are developing a Silverlight 4 application by using the Grid control. Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist

(MCTS)Total Questions:150 Page 22 of 85 You need to ensure that the Grid has three evenly spaced columns that fill the w idth of the Grid.Which XAML fragment should you use?A. <Grid Height="50" Width=" 300"><Grid.ColumnDefinitions><ColumnDefinition Width="1.33"/><ColumnDefinition W idth="1.33"/><ColumnDefinition Width="1.33"/></Grid.ColumnDefinitions></Grid>B. <Grid Height="50" Width="300"><Grid.ColumnDefinitions><ColumnDefinition Width="0 .33"/><ColumnDefinition Width="Auto" /><ColumnDefinition Width="Auto"/></Grid.Co lumnDefinitions></Grid>C. <Grid Height="50" Width="300"><Grid.ColumnDefinitions> <ColumnDefinition Width="0.33*"/><ColumnDefinition Width="0.33*"/><ColumnDefinit ion Width="0.33*"/></Grid.ColumnDefinitions></Grid>D. <Grid Height="50" Width="3 00"><Grid.ColumnDefinitions><ColumnDefinition Width="1"/><ColumnDefinition Width ="1*"/><ColumnDefinition Width="1"/></Grid.ColumnDefinitions></Grid> Answer: CQuestion: 31. You are developing a Silverlight 4 application that allows users to arrange imag es. You need tocreate three objects in the shape of ellipses as shown in the fol lowing image.Which value of ZIndex should you set to each ellipse?A. Red = 2Blue = 1Green = 0B. Red = 2Blue = 0Green = 1C. Red = 0Blue = 1Green = 2D. Red = 1Blue = 0 2 Answer: A Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 23 of 85 Question: 32. You are developing a Silverlight 4 application. The application contains a contr ol that allows usersto select user profile options. You need to define a set of controls that allows users to selectbetween the following background colors:WhiteG rayYou also need to define a set of controls that allows users to select between the followingdefau lt window sizes:900 x 700700 x 500Which XAML fragment should y ou use?A. <RadioButton x:Name="White" Content="White" /><RadioButton x:Name="Gra y" Content="Gray" /><RadioButton x:Name="900x700" Content="900 x 700" /><RadioBu tton x:Name="700x500" Content="700 x 500" />B. <RadioButton x:Name="White" Group Name="Backgrounds" Content="White" /><RadioButton x:Name="Gray" GroupName="Backg rounds" Content="Gray" /><RadioButton x:Name="900x700" GroupName="WindowSizes" C ontent="900 x 700" /><RadioButton x:Name="700x500" GroupName="WindowSizes" Conte nt="700 x 500" />C. <RadioButton x:Name="White" Content="White" /><RadioButton x :Name="Gray" Content="Gray" /><Line Stroke="Black" StrokeThickness="4"/><RadioBu tton x:Name="900x700" Content="900 x 700" /><RadioButton x:Name="700x500" Conten t="700 x 500" />D. <RadioButton x:Name="White" GroupName="ProfileSettings" Conte nt="White" /><RadioButton x:Name="Gray" GroupName="ProfileSettings" Content="Gra y" /><Line Stroke="Black" StrokeThickness="4"/><RadioButton x:Name="900x700" Gro upName="ProfileSettings" Content="900 x 700" /><RadioButton x:Name="700x500" Gro upName="ProfileSettings" Content="700 x 500" /> Answer: BQuestion: 33. You are developing a Silverlight 4 application.You have a page that contains the following XAML fragment.<StackPanel Orientation="Vertical"><Grid x:Name="Master "><ListBox x:Name="lstOrders" /></Grid><Grid x:Name="Details"><ListBox x:Name="l stOrdersDetails" /><myControls:DetailsViewLoading /></Grid></StackPanel>The appl ication defines the DetailsViewLoading user control by using the followingXAML f ragm ent. (Line numbers are included for reference only.)01 <UserControl x:Class ="DetailsViewLoading"xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presenta tionxmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">02 <Grid>0304 Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 24 of 85 05 <StackPanel>06 <TextBlock Text="Loading Details..."/>07 <Button Content="Clos e" Click="CloseBtn_Click"/>08 </StackPanel>09</Border>10 </Grid>11 </UserControl >You need to display the DetailsViewLoading user control on top of the other con

tent in the DetailsGrid control. You also need to ensure that the rest of the co ntent in the Details Grid control isunavailable until the DetailsViewLoading use r control is closed. Which XAML fragment shouldyou insert at lines 03 and 04?A. <Border CornerRadius="30" Background="#FF5C7590" Width="600"Height="250"><Rectan gle HorizontalAlignment="Stretch" VerticalAlignment="Stretch"Opacity="0.765" Fil l="#FF8A8A8A"/>B. <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="St retch"Opacity="0.765" Fill="#FF8A8A8A"/><Border CornerRadius="30" Background="#F F5C7590" Width="600" Height="250">C. <Border CornerRadius="30" Background="#FF5C 7590" Width="600"Height="250"><Rectangle HorizontalAlignment="Center" VerticalAl ignment="Center"Opacity="0.765" Fill="#FF8A8A8A"/>D. <Rectangle HorizontalAlignm ent="Center" VerticalAlignment="Center"Opacity="0.765" Fill="#FF8A8A8A"/><Border CornerRadius="30" Background="#FF5C7590" Width="600" Height="250"> Answer: BQuestion: 34. You are developing a Silverlight 4 application.You need to specify that the "/Sa les/June/Short" uniform resource identifier (URI) patternis ma pped to the follo wing URI. /Views/Reports/Sales.xaml time=June&show=ShortWhich URI mapping should you add?A. <sdk:UriMapping Uri="/{reporttype}/{month}/{format}" Mapped Uri="/{r eporttype} .xaml time={month}&amp;show={format}"/>B. <sdk:UriMapping Uri="/{repo rttype}.xaml time={month}&amp;show={format}"MappedUri="/{reporttype}/{month}/{fo rmat}"/>C. <sdk:UriMapping Uri="/{reporttype}/{month}/{format}"MappedUri="/Views /Reports/{reporttype}.xaml time={month}&amp;show={format}"/>D. <sdk:UriMapping U ri="/Views/Reports/{reporttype}.xamltime={month}&amp;show={format}" MappedUri="/ {reporttype}/{month}/{format}"/> Answer: CQuestion: 35. You are developing a Silverlight 4 application.The application defines the follo wing XAML fragment. (Line numbers are included forreference only.)01 <Grid x:Nam e="LayoutRoot">02 <sdk:Frame x:Name="ContentFrame" Source="/Home">03 <sdk:Frame. UriMapper>04 <sdk:UriMapper x:Name="ContentMapper"> Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 25 of 85 05 <sdk:UriMapping Uri="/{pageName}"MappedUri="/Views/{pageName}.xaml"/>06 </sdk :UriMapper>07 </sdk:Frame.UriMapper>08 </sdk:Frame>09 <Grid>1011 </Grid>12 </Gri d>You need to define a hyperlink that navigates to a resource within the Frame. WhichXAML fragment should you insert at line 10?A. <HyperlinkButton NavigateUri= "/About" TargetName="ContentMapper" />B. <HyperlinkButton NavigateUri="/About" T argetName="ContentFrame" />C. <HyperlinkButton NavigateUri="/About" TargetName=" _parent" />D. <HyperlinkButton NavigateUri="/About" TargetName="_top" /> Answer: BQuestion: 36. You are developing a Silverlight 4 application. You need to add a MediaElement c ontrol thathandles when the media has finished playing. Which XAML fragment shou ld you use?A. <MediaElement x:Name="MediaElement1" AutoPlay="True"MediaEnded="Me diaElement1_MediaEnded"/>B. <MediaElement x:Name="MediaElement1" AutoPlay="True" MediaOpened="MediaElement1_MediaOpened"/>C. <MediaElement x:Name="MediaElement1" AutoPlay="True"MarkerReached="MediaElement1_MarkerReached"/>D. <MediaElement x: Name="MediaElement1" AutoPlay="True"CurrentStateChanged="MediaElement1_CurrentSt ateChanged" /> Answer: AQuestion: 37. You are developing a Silverlight 4 application.You need to create an implicit st yle for a ComboBox that specifies the following settings:FontFamily = VerdanaForeg round = GreenWhich XAML fragment should you use?A. <StyleTargetType="ComboBox">< Setter Property="FontFamily" Value="Verdana" /><Setter Property="Foreground" Val ue="Green" /></Style>B. <Stylex:Key="StandardComboBox" TargetType="ComboBox"><Se tter Property="FontFamily" Value="Verdana" /><Setter Property="Foreground" Value ="Green" /></Style>C. <Stylex:Name="StandardComboBox"><Setter Property="FontFami ly" Value="Verdana" /><Setter Property="Foreground" Value="Green" /> Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150

Page 26 of 85 </Style>D. <Style><Setter Property="FontFamily" Value="Verdana" /><Setter Proper ty="Foreground" Value="Green" /></Style> Answer: A Question: 38. You are developing a Silverlight 4 application. You define a style according to thefollowingXAMLfragment.<Style TargetType="Button"><Setter Property="Width" Val ue="75" /><Setter Property="Height" Value="23" /></Style>You need to implement a new button that will override this style by using the defaultSilverlight style. Which XAML fragment should you use?A. <Button x:Name="DocumentsButton" Style="{S taticResource null}"Content="Documents" />B. <Button x:Name="DocumentsButton" St yle="{ }" Content="Documents" />C. <Button x:Name="DocumentsButton" Style="{x:Nu ll}" Content="Documents" />D. <Button x:Name="DocumentsButton" Content="Document s" /> Answer: CQuestion: 39. You are developing a Silverlight 4 application. The following ControlTemplate ha s beendefined as a Resource. <ControlTemplate TargetType="TextBox"x:Key="TextBox Template"><! custom code... ></ControlTemplate>You need to set a TextBox control to use the resource. Which XAML fragment shouldyou use?A. <TextBox Template="{S taticResource TextBoxTemplate}" />B. <TextBox Text="{StaticResource TextBoxTempl ate}" />C. <TextBox Style="{StaticResource TextBoxTemplate}" />D. <TextBox Resou rces="{StaticResource TextBoxTemplate}" /> Answer: AQuestion: 40. You are developing a Silverlight 4 application.The application contains the foll owing XAML fragment.<ComboBox Style="{StaticResource ComboBoxTemplate}" />You ne ed to add a custom control template to the ComboBoxTemplate style for theComboBo x control. Which XAML fragment should you use?A. <Style x:Key="ComboBoxTemplate" TargetType="ComboBox"><Setter Property="ControlTemplate"><! customized content > </Setter> Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 27 of 85 </Style>B. <Style x:Key="ComboBoxTemplate" TargetType="ComboBox"><Setter><Setter .Value><ControlTemplate TargetType="ComboBox"><! customized content ></ControlTem plate></Setter.Value></Setter></Style>C. <Style x:Key="ComboBoxTemplate"><Setter Property="ComboBox"><Setter.Value><ControlTemplate><! customized content ></Cont rolTemplate></Setter.Value></Setter></Style>D. <Style x:Key="ComboBoxTemplate" T argetType="ComboBox"><Setter Property="Template"><Setter.Value>ControlTemplate T argetType="ComboBox"><! customized content ></ControlTemplate></Setter.Value></Se tter></Style> Answer: DQuestion: 41. You are developing a lineof-business application by using Silverlight 4. The appl ication will beused for data entry and reporting purposes. You need to implement a DataGrid control that willallow editing of bound data. Which XAML fragment sh ould you use?A. <grid:DataGridTemplateColumn Header="Supplier"><grid:DataGridTem plateColumn.CellTemplate><DataTemplate><TextBlock Text="{Binding Path=Supplier}" /></DataTemplate></grid:DataGridTemplateColumn.CellTemplate></grid:DataGridTemp lateColumn>B. <grid:DataGridTemplateColumn Header="Supplier"><grid:DataGridTempl ateColumn.CellStyle><Style TargetType="grid:DataGridTemplateColumn"><Setter Valu e="Template" Property="EditTemplate" /></Style></grid:DataGridTemplateColumn.Cel lStyle></grid:DataGridTemplateColumn>C. <grid:DataGridTemplateColumn Header="Sup plier"><grid:DataGridTemplateColumn.CellTemplate><DataTemplate><TextBox Text="{B inding Path=Supplier}" /></DataTemplate> Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 28 of 85 </grid:DataGridTemplateColumn.CellTemplate></grid:DataGridTemplateColumn>D. <gri d:DataGridTemplateColumn Header="Supplier"><grid:DataGridTemplateColumn.CellTemp

late><DataTemplate><TextBlock Text="{Binding Path=Supplier}" /></DataTemplate></ grid:DataGridTemplateColumn.CellTemplate><grid:DataGridTemplateColumn.CellEditin gTemplate><DataTemplate><TextBox Text="{Binding Path=Supplier}"/></DataTemplate> </grid:DataGridTemplateColumn.CellEditingTemplate></grid:DataGridTemplateColumn> Answer: DQuestion: 42. You are developing a Silverlight 4 application.The application contains an Image control to display an image.You need to modify the application to display the i mage on its side. Which XAML fragment shouldyou use?A. <Image.Projection><PlaneP rojection RotationY="90"/></Image.Projection>B. <Image.RenderTransform><Composit eTransform TranslateY="90"/></Image.RenderTransform>C. <Image.RenderTransform><C ompositeTransform Rotation="90"/></Image.RenderTransform>D. <Image.RenderTransfo rm><CompositeTransform ScaleY="90"/></Image.RenderTransform> Answer: CQuestion: 43. You are developing a Silverlight 4 application.The application defines the follo wing XAML fragment. (Line numbers are included forreference only.)01 <Canvas Wid th="400" Height="300">02 <Canvas.Resources>03 <Storyboard x:Name="myStoryboard"> 04 <PointAnimationUsingKeyFrames Storyboard.TargetProperty="Center"Storyboard.Ta rgetName="AnimatedEllipse">05 <EasingPointKeyFrame Value="50,20" KeyTime="00:00: 02">06<EasingPointKeyFrame.EasingFunction>0708 </EasingPointKeyFrame.EasingFunct ion>09 </EasingPointKeyFrame>10 </PointAnimationUsingKeyFrames>11 </Storyboard> Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 29 of 85 12 </Canvas.Resources>13 <Path Fill="Blue">14<Path.Data>15 <EllipseGeometry x:Na me="AnimatedEllipse" RadiusX="15" RadiusY="15" />16 </Path.Data>17 </Path>18 </C anvas>You need to animate the ellipse so that the ellipse moves to the upper bou ndary ofthe canvas where it slows down and stops. Which code fragment should you insert at line07?A. <QuintiEase EasingMode="EaseIn"/>B. <BackEase EasingMode="E aseIn"/>C. <CubicEase EasingMode="EaseOut"/>D. <SineEase EasingMode="EaseInOut"/ > Answer: CQuestion: 44. You are developing a Silverlight 4 application. The application has an XAMLpage that contains the following XAML fragment. (Line numbers are included forreferen ce only.)01 <ComboBox x:Name="cbName">02 <ComboBoxItem Content="One"/>03 <ComboB oxItem Content="Two"/>04 </ComboBox>05 <Rectangle>06 <i:Interaction.Triggers>070 8 </i:Interaction.Triggers>09 </Rectangle>You need to allow the user to call an ICommand named GetPeopleCommand when the userclicks the Rectangle. You also need to pass the selected value of theComboBox to GetPeopleCommand. Which XAML fragm ent should you insert at line 07?A. <i:EventTrigger EventName="MouseLeftButtonDo wn"><i:InvokeCommandAction Command="{Binding GetPeopleCommand}"CommandParameter= "{Binding SelectedItem, ElementName=cbName}"/></i:EventTrigger>B. <i:EventTrigge r EventName="MouseButtonDown"><i:InvokeCommandAction Command="{Binding GetPeople Command}"CommandParameter="{Binding SelectedItem, ElementName=cbName}"/></i:Even tTrigger>C. <i:EventTrigger EventName="MouseLeftButtonDown"><i:InvokeCommandActi on Command="{Binding GetPeopleCommand}"CommandParameter="{Binding SelectedValue, ElementName=cbName}"/></i:EventTrigger>D. <i:EventTrigger EventName="MouseButto nDown"><i:InvokeCommandAction Command="{Binding GetPeopleCommand}"CommandParamet er="{Binding SelectedValue, ElementName=cbName}"/></i:EventTrigger> Answer: A Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 30 of 85 Question: 45. You are developing a Silverlight 4 application. You define two VisualStates name d Fail and Pas sfor a custom control. You need to ensure that the transition fro m the Fail state to the Pass stat etakes two seconds. Which XAML fragment should you use?A. <VisualTransition From="Fail" To="Pass"GeneratedDuration="0:0:2" />B . <VisualTransition From="Fail" /><VisualTransitionTo="Pass" /><VisualTransition

GeneratedDuration="0:0:2" />C. <VisualTransition From="Fail"To="Pass" /><Visual Transition GeneratedDuration="0:0:2" />D. <VisualTransition From="Pass" Generate dDuration="0:0:2" /><VisualTransitionTo="Fail" GeneratedDuration="0:0:2" /> Answer: AQuestion: 46. You are developing an application by using Silverlight 4 and Microsoft .NET Fram ework4. You add the following XAML fragment. (Line numbers are included for refe rence only.)01 <Grid x:Name="LayoutRoot">02 <Grid.ColumnDefinitions>03 <ColumnDe finition />04 <ColumnDefinition />05 </Grid.ColumnDefinitions>0607 </Grid>You ne ed to add a Button control inside the second column of the Grid control. You als o need t oset the content and the tooltip of the Button control to Send and Send document, respectively.Which XAML fragment should you insert at line 06?A. <But ton Grid.Column="1"><ToolTipService.ToolTip><ToolTip>Send document</ToolTip></To olTipService.ToolTip> Send</Button>B. <Button><ToolTipService.ToolTip><ToolTip>S end document</ToolTip></ToolTipService.ToolTip> Send</Button>C. <Button Grid.Col umn="1"><Canvas><ToolTip>Send document</ToolTip><TextBlock>Send</TextBlock></Can vas></Button>D. <Button><Canvas><ToolTip>Send document</ToolTip><TextBlock>Send< /TextBlock></Canvas> Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 31 of 85 </Button> Answer: AQuestion: 47. You are developing an application by using Silverlight 4 and Microsoft .NET Fram ework4.You add a class named CreateOrderCommand in the application. You implemen t theIComman d interface in the CreateOrderCommand class. You also create a clas s namedCreateOrderVie wModel. You add the following XAML fragmentto create a Use rControl named CreateOrder. (Line numbers areincluded for reference only.)01 <Us erControl.Resources>02 <local:CreateOrderViewModel x:Key="vm" />03 </UserControl .Resources>0405 <Grid x:Name="LayoutRoot" DataContext="{StaticResource vm}" >060 7 </Grid>You need to bind the CreateOrderCommand command to a Button control. Wh at shouldyou do?A. Create a property named CreateOrder in the codebehind class of the CreateOrdercontrol.Set the type of the CreateOrder property to CreateOrderCo mmand.Add the following XAML fragment at line 06.<Button Content="Create" Command ="CreateOrder" />B. Create a property named CreateOrder in the codebehind class o f the CreateOrdercontrol.Set the type of the CreateOrder property to CreateOrderC ommand.Add the following XAML fragment at line 06.<Button Content="Create" Comman d="CreateOrder.CreateOrder" />C. Create a property named CreateOrder in the Creat eOrderViewModel class.Set the type of the CreateOrder property to CreateOrderComm and.Add the following XAML fragment at line 06.<Button Content="Create" Command=" {Binding CreateOrder}" />D. Create a property named CreateOrder in the CreateOrde rViewModel class.Set the type of the CreateOrder property to CreateOrderCommand.Ad d the following XAML fragment at line 06.<Button Content="Create" Command="{Bind ing CreateOrder.CreateOrder}" /> Answer: CQuestion: 48. You are developing an application by using Silverlight 4 and Microsoft .NET Fram ework4. You create a class named SendMessageCommand that implements the ICommand interface.You bind the SendMessageCommand class as a command for a Button contr ol.You need to ensure t hat the SendMessageCommand class receives the Text prope rty of aTextBox control named t xtMessage as a parameter. Which value should you set in theCommandParameter property of the Button control?A. txtMessage.TextB. {Binding txtMessage, Path=TextBox.Text}C. {Binding ElementName=txtMessage, Path= Text}D. {Binding ElementName=txtMessage, Path=TextBox.Text} Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 32 of 85 Answer: CQuestion: 49.

You are developing a Silverlight 4 application. The application contains a TextB lock control thathas the DataContext property set to an object. The object expos es a property named Today ofthe DateTime data type. The Today property returns D ateTime.Today.You need to display the string "Today is " concatenated with the v alue of Today in theTextBlock control by using only X AML. Which binding express ion should you use?A. {Binding Today, StringFormat='Today is'}B. {Binding Today, StringFormat='Today is {0}'}C. {Binding Today, ConverterParameter='Today is '}D . {Binding Today, StringFormat='Today is {Today}'} Answer: BQuestion: 50. You are developing a Silverlight 4 application. The application has a UserContro l that has aTextBox named FirstName. You need to display the string "Hello" conc atenated with the valueentered in the TextBox. Which XAML fragment should you us e?A. <TextBlock Text="Hello {Binding Path=Text, ElementName=FirstName}" />B. <Te xtBlock Text="{Binding Path=Hello, ConverterParameter=FirstName}" />C. <TextBloc k Text="{Binding Path=Text, StringFormat='Hello {FirstName}'}" />D. <TextBlock T ext="{Binding Path=Text, ElementName=FirstName,StringFormat='Hello {0}'}" /> Answer: DQuestion: 51. You are developing a Silverlight 4 application. The application contains a Perso n class that has apublic nullable DateTime property named Birthday. You display a list ofPerson objects in a D ataGrid control. One of the columns in the DataGr id control is bound toBirthday. You need to ensure that the databound column dis plays Birthday by using the long dateformat.Which binding expression should you use?A. {Binding Path=Birthday, FallbackValue='D'}B. {Binding Path=Birthday, Stri ngFormat=\{0:D\}}C. {Binding Path=Birthday, ConverterParameter=\{0:D\}}D. {Bindi ng Path=Birthday, TargetNullValue='LongDatePattern'} Answer: BQuestion: 52. You are developing a Silverlight 4 application. The application contains a Car c lass thatimplements t h eINotifyPropertyChangedinterface.Theapplication a l so h as a publicObservableCollection<string> property named Tires and a public string property namedSelectedTire. The application has a user control that contains th e following XAML fragment.(Line numbers are included for reference only.)01 <Use rControl>02 <StackPanel>03 <ListBox ItemsSource="{Binding Path=Tires}" /> Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 33 of 85 04 <TextBox Text="{Binding Path=SelectedTire}" />05 </StackPanel>06 </UserContro l>You need to modify the user control to meet the following requirements:When the selected item in the ListBox is changed, the SelectedTire property in the Car c lass isupdated.When no item is selected in the ListBox, the text in the TextBox i s set to "No value selected."When the text in the TextBox is changed to a valid e ntry in the Tires collection, the selected ite min the ListBox is changed.Which XAML fragment should you replace at lines 03 and 04?A. <ListBox ItemsSource="{Bi nding Path=Tires}" SelectedItem="{BindingPath=SelectedTire}" /><TextBox Text="{B inding Path=SelectedTire, TargetNullValue='No value selected',Mode=TwoWay}" />B. <ListBox ItemsSource="{Binding Path=Tires}" SelectedItem="{BindingPath=Selected Tire, Mode=TwoWay}" /><TextBox Text="{Binding Path=SelectedTire, TargetNullValue ='No value selected',Mode=TwoWay}" />C. <ListBox ItemsSource="{Binding Path=Tire s}" SelectedItem="{BindingPath=SelectedTire, Mode=TwoWay}" /><TextBox Text="{Bin ding Path=SelectedTire, Mode=TwoWay}" />D. <ListBox ItemsSource="{Binding Path=T ires}" SelectedItem="{BindingPath=SelectedTire, Mode=TwoWay}" /><TextBox Text="{ Binding Path=SelectedTire, TargetNullValue='No value selected'}" /> Answer: BQuestion: 53. You are creating a Silverlight 4 application. The application contains a Person class that has apublic property named Address. The application contains a TextBo x control that is data bound tothe Address property. You need to ensure that the following requirements are met:When the Address property changes, the TextBox co ntrol is automatically updated.When the TextBox control changes, the Address prop erty is not automatically updated.Which t wo tasks should you perform?(Each corr

ect answer presents part of the solution. Choose two.)A. Use TwoWay data binding .B. Use OneWay data binding.C. Use OneTime data binding.D. Create a PropertyChan ged event handler in the Person object.E. Implement the INotifyPropertyChanged i nterface in the Person object. Answer: BEQuestion: 54. You are developing a Silverlight 4 application. The application contains a Slide r control namedTemperature. You need to display the Value property of Temperatur e in aTextBlock control. Which XAML fragment should you use?A. <TextBlock Text=" {Binding Path=Temperature.Value}" />B. <TextBlock Text="{Binding Path=Value, Sou rce=Temperature}" />C. <TextBlock Text="{Binding Path=Value, ElementName=Tempera ture}" /> Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 34 of 85 D. <TextBlock DataContext="{StaticResource Temperature}" Text="{BindingPath=Valu e}" /> Answer: CQuestion: 55. You are developing a Silverlight 4 application. The application contains a Produ ct class that has ap ublicBooleanpropertynamed IsAvailable. The application also contains aBoolToVisibilityConverter class. You create an XAML page that contain s a Button control. Thepage is data bound to an instance of the Product class. Y ou need to ensure that the Buttoncontrol is visible only if the IsAvailable prop erty is true. Which two tasks should you perform?(Each correct answer presents p art of the solution. Choose two.)A. Add an instance of the BoolToVisibilityConve rter class in a Resource block.B. Set the Buttons DataContext property to an inst ance of the BoolToVisibilityConverter class.C. Set the UserControls DataContext p roperty to an instance of the BoolToVisibilityConverter class.D. Apply the BoolT oVisibilityConverter class to the binding syntax of the Buttons Visibility proper ty.E. Apply the BoolToVisibilityConverter class to the binding syntax of the But tons DataContext property. Answer: ADQuestion: 56. You are developing a Silverlight 4 application. The application contains an Orde rItem class thathas a public interface property named Quantity and a public Deci mal property named UnitPrice.The application also contains an ExtendedPriceConve rter class that calculates the total price forthe OrderItem. The application req uires a UnitPrice in the value of the converter and a Quantityas the parameter. You create an XAML page that contains a TextBlock control. The converter isdefin ed in the page that contains the following XAML fragment. (Line numbers are incl uded forreference only.)01 <UserControl.Resources>02<converters: ExtendedPriceCo nverter x:Key="epc"></converters:ExtendedPriceConverter>03 </UserControl.Resourc es>You need to ensure that the TextBlock control uses ExtendedPriceConverter to displaythe exte nded price when bound to an OrderItem.Which XAML fragment should you use?A. <TextBlock Text="{Binding Path=UnitPrice, Converter={StaticResource epc},ConverterParameter='{Binding Quantity}'}" />B. <TextBlock Text="{Binding Pa th=UnitPrice, Converter={StaticResource epc},ConverterParameter=Quantity}" />C. <TextBlock Text="{Binding Path=UnitPrice, ConverterParameter='{Binding Quantity} '}" />D. <TextBlock Text="{Binding Path=UnitPrice, Converter={StaticResource epc },ConverterParameter='Binding Quantity'}" /> Answer: AQuestion: 57. You are developing a Silverlight 4 application. The application contains a TextB ox control databound to a class that implements only the INotifyPropertyChanged interface.When an invalid value is entered in the TextBox control, the class wil l throw a Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 35 of 85

ValidationException in the Set bloc k of its Name property. You need to display the validationerror when an invalid value is entered in the TextBox control. Whi ch XAML fragment should youuse?A. <TextBox Text="{Binding Name, Mode=TwoWay, Val idatesOnExceptions=True}" />B. <TextBox Text="{Binding Name, Mode=OneWay, Valida tesOnExceptions=True}" />C. <TextBox Text="{Binding Name, Mode=TwoWay, NotifyOnV alidationError=True}" />D. <TextBox Text="{Binding Name, Mode=OneWay, NotifyOnVa lidationError=True}" /> Answer: AQuestion: 58. You are developing a Silverlight 4 application. The application contains a form that has aGrid control and several input fields. The data context is bound to an object that implementsvalidation. You need to display a summary of validation e rrors. Which two actions should youperform?(Each correct answer presents part of the solution. Choose two.)A. Add a ValidationSummary control.B. Add a ListBox c ontrol and bind it to the Validation.Errors property of the Grid control.C. Set Validation.HasError="True" on the Grid control if any of the fields contains an error.D. Set NotifyOnValidationError=true and Mode=TwoWay on each fields binding expression. Answer: ADQuestion: 59. You are developing a trusted application by using Silverlight 4. The application will upload imagesto a server. You need to provide a user with two ways to sele ct an image file from the C:\Tempfolder on the client computer.Which two actions should you perform?(Each correct answer presents a complete solution. Choose tw o.)A. Use the OpenFileDialog class.B. Use the Clipboard class to allow the copya ndpaste functionality on the images.C. Use the Rectangle control as a dropzone a nd set the AllowDrop property of the control to tru e.D. Use the Environment.Get FolderPath and Environment.SpecialFolder methods to access a fil especified by t he user. Answer: ACQuestion: 60. You are developing a Silverlight 4 application. You handle the RightMouseButtonD own event ofthe applications layout root element to display a shortcut menu. You discover t hat when the rightmouse button is released, the standard information panel in Silverlight appears.You need to prevent the standard information panel in Silverlight from being displayed.What should you do?A. Handle the KeyDown eve nt.B. Handle the RightMouseButtonUp event.C. Set the MouseButtonEventArgs.Handle d property to True.D. Set the layout root elements IsHitTestVisible property to F alse. Answer: C Exam Name:Microsoft Silverlight 4, DevelopmentExam Type: MicrosoftExam Code:70-506CertificationMicrosoft Certified Technology Specialist (MCTS)Total Questions:150 Page 36 of 85 Question: 61. You are developing a Silverlight 4 application. The application has a page that contains aSlider control named sldAmount. You need to enable the wheel of the mo use to controlsldAmount. What should you do?A. Handle the ManipulationDelta event on sldAmount.Increase sldAmount.SmallChange if the e.DeltaManipulation.Translati on.X argument ispositiv e. Decrease sldAmount.SmallChange if the e.DeltaManipulat ion.Translation.Xargument is neg ative.B. Handle the ManipulationDelta event on s ldAmount.Increase sldAmount.Value if the e.DeltaManipulation.Translation.X argume nt ispositive.Decrease sldAmount.Value if the e.DeltaManipulation.Translation.X a rgument isnegative.C. Handle the MouseWheel event on sldAmount.Increase sldAmount. SmallChange if the e.Delta argument is positive.Decrease sldAmount.SmallChange if the e.Delta argument is negative.D. Handle the MouseWheel event on sldAmount.Incr ease sldAmount.Value if the e.Delta argument is positive.Decrease sldAmount.Value if the e.Delta argument is negative. Answer: DQuestion: 62. You are developing an application by using Silverlight 4 and Microsoft .NET Fram ework4.The application contains the following XAML fragment. (Line numbers are i ncluded forreference only.)01 <Grid x:Name="LayoutRoot" Background="White">02 <G

rid.Resources>03 <vm:Customers x:Key="CustomerVM"/>04 <vm:MockCustomers x:Key="M ockCustomerVM"/>05 </Grid.Resources>06 <sdk:DataGrid AutoGenerateColumns="True"0 7 ItemsSource="{Binding CustomerList}" />08 </Grid>You need to bind the DataGrid to the CustomerList property in MockCustomerVM atdesign tim e. You also need to bind the DataGrid to the CustomerList property inCustomerVM at run time. Which XAML fragment should you insert between lines 06 and 07?A. d:Data Context =" {St atic Resource Mock Customer VM}" Data Context ="{StaticResource Customer VM}"B. DataContext="{StaticResource MockCustomerVM}"d:DataContext="{StaticResource Cust omerVM}"C. Data Context ="{Static Resource Mock Customer VM }"ItemsControl.Items Source="{StaticResource CustomerVM}"D. d:Data Context ="{Static Resource Mock Cu stomer VM}"ItemsControl.ItemsSource="{StaticResource CustomerVM}" Answer: AQuestion: 63. You are developing a Web application by using Silverlight 4 and Microsoft Visual Studio of 85 Leave a Comment

Submit Characters: 400

Submit Characters: ... Category: Uncategorized. Rating: Upload Date: 01/25/2012 Copyright: Attribution Non-commercial Tags: This document has no tags.

Upload Search

Follow Us! scribd.com/scribd twitter.com/scribd facebook.com/scribd About Press Blog Partners Scribd 101 Web Stuff Support FAQ Developers / API Jobs Terms Copyright Privacy

Copyright 2012 Scribd Inc. Language: English scribd. scribd. scribd. < div style="display: none;"><img src="//pixel.quantserve.com/pixel/p-13DPpb-yg8 ofc.gif" height="1" width="1" alt="Quantcast"/></div>

Вам также может понравиться