Test your knowledge

  1. You are developing a web application using Silverlight 4. In your application, you have a Grid element. On the top of your page, you have the following code:
    <UserControl.Resources>
    <SolidColorBrush x:Key='GridBackground' Color='Black'/>
    </UserControl.Resources>
    

    The Grid element looks as follows:

    <Grid x:Name='LayoutRoot' Background='White'></Grid>
    

    What will be the background color of the Grid?

    a. Black

    b. White

    c. Impossible to know

    d. Azure

  2. You are developing a Silverlight 4 application. Your application contains a custom control with various visual states. You need to change the visual state of the control to a visual state called 'Hover'. Which code should you use?

    a.<VisualState ChangeTo='Hover'></VisualState>

    b.<Storyboard To='Hover'></Storyboard>

    c. VisualStateManager.GoToState(this,'Hover',true);

    d.<VisualState>

    <Storyboard ChangeTo='Hover'></Storyboard>

    </VisualState>

  3. You are tasked with creating an implicit style for ComboBox that specifies the following settings—FontFamily = Arial, Foreground = Azure. Which XAML fragment should you use?

    a.<Style>

    <Setter Property='FontFamily' Value='Arial'/>

    <Setter Property='Foreground' Value='Azure'/>

    b.<Style x:Name='MyComboBox'>

    <Setter Property='FontFamily' Value='Arial'/>

    <Setter Property='Foreground' Value='Azure'/>

    c.<Style x:Key='MyCombobox' TargetType='ComboBox'>

    <Setter Property='FontFamily' Value='Arial'/>

    <Setter Property='Foreground' Value='Azure'/>

    d.<Style TargetType='Combobox'>

    <Setter Property='FontFamily' Value='Arial'/>

    <Setter Property='Foreground' Value='Azure'/>

  4. You are creating a Silverlight 4 based image gallery application. You need to apply manipulations to your image. Each image manipulation consists of a scale transform and rotation transform. Which of the following codes fulfill the requirement?

    a. <Image.RenderTransform>

    <TransformGroup>

    <ScaleTransform ScaleX="0.7" ScaleY="0.7" CenterX="30" CenterY="30"/>

    <RotateTransform Angle="90"/>

    </TransformGroup>

    b.<ScaleTransform ScaleX="0.7" ScaleY="0.7" CenterX="30" CenterY="30"/>

    <RotateTransform Angle="90"/>

    c. <Image.RenderTransform>

    <TransformGroup>

    <ScaleTransform ScaleX="0.7" ScaleY="0.7" CenterX="30" CenterY="30"/>

    </TransformGroup>

    </Image.RenderTransform><Image.RenderTransform>

    <TransformGroup>

    <RotateTransform Angle="90"/>

    </TransformGroup>

    d.<Image.RenderTransform>

    <ScaleTransform ScaleX="0.7" ScaleY="0.7" CenterX="30" CenterY="30"/>

    <RotateTransform Angle="90"/>

  5. You are creating a Silverlight 4 application that relies heavily on visual manipulations. How can you improve the performance of your application?

    a. Add the EnableGPUAcceleration parameter for the Silverlight object tag.

    b. Set the CacheMode property of the visual elements to BitmapCache.

    c. Add both the EnableGPUAcceleration and BitmapCache parameters to the Silverlight object tag.

    d. Only the combination of answers a and b will improve the performance of the application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.159.82