Which XAML fragment should you use?
You are developing a Silverlight 4 application. The application contains a Slider control named Temperature. You need to display the Value property of Temperature in a
TextBlock control. Which XAML fragment should you use?
Which two tasks should you perform?
You are creating a Silverlight 4 application. The application contains a Person class that has a public property named Address. The application contains a TextBox control that is data bound to the Address property. You need to ensure that the following requirements are met:
When the Address property changes, the TextBox control is automatically updated.
When the TextBox control changes, the Address property is not automatically updated.
Which two tasks should you perform? (Each correct answer presents part of the solution. Choose two.)
Which XAML fragment should you replace at lines 03 and 04?
You are developing a Silverlight 4 application. The application contains a Car class that implements the INotifyPropertyChangedinterface.Theapplication also has a public ObservableCollection<string> property named Tires and a public string property named SelectedTire. The application has a user control that contains the following XAML fragment.
(Line numbers are included for reference only.)
01 <UserControl>
02 <StackPanel>
03 <ListBox ItemsSource=”{Binding Path=Tires}” />
04 <TextBox Text=”{Binding Path=SelectedTire}” />
05 </StackPanel>
06 </UserControl>
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 class is updated.
When no item is selected in the ListBox, the text in the TextBox is set to “No value selected.”
When the text in the TextBox is changed to a valid entry in the Tires collection, the selected item in the ListBox is changed.
Which XAML fragment should you replace at lines 03 and 04?
Which binding expression should you use?
You are developing a Silverlight 4 application. The application contains a Person class that has a public nullable DateTime property named Birthday. You display a list of Person objects in a DataGrid control. One of the columns in the DataGrid control is bound to Birthday. You need to ensure that the databound column displays Birthday by using the long date format.
Which binding expression should you use?
Which XAML fragment should you use?
You are developing a Silverlight 4 application. The application has a UserControl that has a TextBox named FirstName. You need to display the string “Hello” concatenated with the value
entered in the TextBox. Which XAML fragment should you use?
Which binding expression should you use?
You are developing a Silverlight 4 application. The application contains a TextBlock control that has the DataContext property set to an object. The object exposes a property named Today of the DateTime data type. The Today property returns DateTime.Today. You need to display the string “Today is ” concatenated with the value of Today in the TextBlock control by using only XAML. Which binding expression should you use?
Which value should you set in the CommandParameter property of the Button control?
You are developing an application by using Silverlight 4 and Microsoft .NET Framework 4. You create a class named SendMessageCommand that implements the ICommand interface.
You bind the SendMessageCommand class as a command for a Button control. You need to ensure t hat the SendMessageCommand class receives the Text property of a TextBox control named txtMessage as a parameter. Which value should you set in the CommandParameter property of the Button control?
What should you do?
You are developing an application by using Silverlight 4 and Microsoft .NET Framework 4. You add a class named CreateOrderCommand in the application. You implement the ICommand interface in the CreateOrderCommand class. You also create a class named CreateOrderVie wModel. You add the following XAML fragment to create a UserControl named CreateOrder. (Line numbers are included for reference only.)
01 <UserControl.Resources>
02 <local:CreateOrderViewModel x:Key=”vm” />
03 </UserControl.Resources>
04
05 <Grid x:Name=”LayoutRoot” DataContext=”{StaticResource vm}” >
06
07 </Grid>
You need to bind the CreateOrderCommand command to a Button control. What should you do?
Which XAML fragment should you insert at line 06?
You are developing an application by using Silverlight 4 and Microsoft .NET Framework 4. You add the following XAML fragment. (Line numbers are included for reference only.)
01 <Grid x:Name=”LayoutRoot”>
02 <Grid.ColumnDefinitions>
03 <ColumnDefinition />
04 <ColumnDefinition />
05 </Grid.ColumnDefinitions>
06
07 </Grid>
You need to add a Button control inside the second column of the Grid control. You also need to set the content and the tooltip of the Button control to Send and Send document, respectively. Which XAML fragment should you insert at line 06?
Which XAML fragment should you use?
You are developing a Silverlight 4 application. You define two VisualStates named Fail and Pass for a custom control. You need to ensure that the transition from the Fail state to the Pass state takes two seconds. Which XAML fragment should you use?