Home »
MCQs
Silverlight MCQs (Multiple-Choice Questions)
Practice these Silverlight MCQs (Multiple-Choice Questions) with answers and explanations to test your knowledge of Microsoft Silverlight, XAML, controls, layouts, data binding, dependency properties, animations, media, navigation, networking, and application development.
Silverlight MCQs
These Silverlight multiple-choice questions cover important concepts of the Silverlight framework, including XAML, C#, controls, panels, dependency properties, data binding, styles, templates, animations, media, navigation, isolated storage, and application deployment.
List of Silverlight MCQs
The following Silverlight MCQs are useful for students, developers, and candidates preparing for technical interviews, examinations, and assessments related to Silverlight application development.
1. What is Microsoft Silverlight?
- A framework for building rich internet applications
- A relational database system
- An operating system
- A web server
Answer: A) A framework for building rich internet applications
Explanation:
Silverlight was Microsoft's framework for developing rich internet applications with features such as XAML-based UI, media, animation, graphics, and managed code.
2. Which markup language is primarily used to define the user interface of a Silverlight application?
- HTML
- XAML
- XML Schema
- JSON
Answer: B) XAML
Explanation:
XAML, or Extensible Application Markup Language, is used to declaratively define Silverlight user interfaces, controls, layouts, styles, and other UI elements.
3. Which programming language was commonly used for Silverlight application logic?
- C#
- SQL
- PHP
- Perl
Answer: A) C#
Explanation:
C# was one of the primary languages used to implement Silverlight application logic. Silverlight also supported other .NET languages.
4. What is the purpose of a Silverlight .xap file?
- To package the Silverlight application for deployment
- To store only HTML source code
- To store a SQL Server database
- To define CSS styles
Answer: A) To package the Silverlight application for deployment
Explanation:
A Silverlight application was commonly packaged into a .xap file containing the application assemblies and resources required by the application.
5. Which file commonly contains the initial XAML UI definition of a Silverlight application?
App.xaml
index.sql
web.config
style.css
Answer: A) App.xaml
Explanation:
App.xaml defines application-level XAML resources and application configuration. Individual pages commonly have their own XAML files.
6. Which class represents the main application object in a Silverlight application?
Application
Window
Browser
SilverlightHost
Answer: A) Application
Explanation:
The Silverlight application class derives from Application and provides application-level behavior and resources.
7. Which event is commonly used when a Silverlight application starts?
Application.Startup
Application.Begin
Application.Load
Application.InitializePage
Answer: A) Application.Startup
Explanation:
The Startup event is raised when the Silverlight application starts.
8. Which Silverlight control is commonly used to display non-editable text?
TextBlock
TextBox
LabelBox
StaticText
Answer: A) TextBlock
Explanation:
TextBlock is commonly used to display text in a Silverlight UI, whereas TextBox is designed for user input.
9. Which Silverlight control allows users to enter or edit text?
TextBox
TextBlock
TextLabel
TextView
Answer: A) TextBox
Explanation:
TextBox provides an editable text input area for Silverlight applications.
10. Which event of a Silverlight Button is commonly handled when the user clicks it?
Click
Pressed
Execute
Selected
Answer: A) Click
Explanation:
The Click event is raised when a Silverlight Button is activated by the user.
11. Which panel arranges Silverlight child elements in rows and columns?
Grid
Canvas
StackPanel
Border
Answer: A) Grid
Explanation:
The Grid panel arranges child elements using rows and columns.
12. Which panel arranges child elements horizontally or vertically in a single line?
StackPanel
Canvas
Grid
Border
Answer: A) StackPanel
Explanation:
StackPanel arranges its children sequentially in either a vertical or horizontal orientation.
13. Which Silverlight panel provides coordinate-based positioning of child elements?
Canvas
Grid
StackPanel
WrapPanel
Answer: A) Canvas
Explanation:
Canvas allows children to be positioned using attached properties such as Canvas.Left and Canvas.Top.
14. Which attached property specifies the horizontal position of an element inside a Canvas?
Canvas.Left
Canvas.Horizontal
Canvas.X
Canvas.PositionX
Answer: A) Canvas.Left
Explanation:
The Canvas.Left attached property specifies the horizontal position of a child element relative to its Canvas.
15. Which attached property specifies the vertical position of an element inside a Canvas?
Canvas.Top
Canvas.Vertical
Canvas.Y
Canvas.PositionY
Answer: A) Canvas.Top
Explanation:
The Canvas.Top attached property specifies the vertical position of a child element inside a Canvas.
16. What is a dependency property in Silverlight?
- A property supported by Silverlight's property system
- A database property
- A CSS property
- A server-side configuration value
Answer: A) A property supported by Silverlight's property system
Explanation:
Silverlight dependency properties participate in the framework's property system and support capabilities such as data binding, animation, styles, and property change notification.
17. Which base class provides the infrastructure for Silverlight dependency properties?
DependencyObject
DependencyProperty
FrameworkProperty
PropertyObject
Answer: A) DependencyObject
Explanation:
Silverlight dependency properties are associated with objects derived from DependencyObject. The DependencyProperty type represents the registered property identifier.
18. Which method is used to register a custom dependency property?
DependencyProperty.Register
DependencyProperty.Create
Property.RegisterDependency
Register.DependencyProperty
Answer: A) DependencyProperty.Register
Explanation:
A custom dependency property is registered using the static Register method of DependencyProperty.
19. What is the conventional name of the static field that stores a dependency property identifier?
- PropertyNameProperty
- DependencyPropertyName
- PropertyIdentifier
- RegisteredProperty
Answer: A) PropertyNameProperty
Explanation:
By convention, a dependency property identifier field is named after the property followed by the suffix Property, such as TextProperty.
20. Which Silverlight feature allows a UI property to obtain its value from a data object?
- Data binding
- CSS inheritance
- SQL binding
- HTML parsing
Answer: A) Data binding
Explanation:
Data binding connects a target dependency property of a UI element with a data source so that values can be transferred between them.
21. Which property is commonly used to provide an inherited data source for child elements in Silverlight?
DataContext
DataSourceContext
BindingContext
SourceContext
Answer: A) DataContext
Explanation:
DataContext can be set on a parent element and inherited by child elements for data binding.
22. Which property of the Binding class specifies the property path on the source object?
Path
SourcePath
PropertyName
DataPath
Answer: A) Path
Explanation:
The Path property specifies the property or subproperty on the data source to which the binding refers.
23. Which Binding property explicitly specifies the object from which data should be obtained?
Source
DataObject
Provider
Origin
Answer: A) Source
Explanation:
The Source property explicitly identifies the object that provides data for a binding. If it is not specified, the binding can use the applicable DataContext.
24. Which interface is commonly used by a Silverlight data source to notify the binding system about property changes?
INotifyPropertyChanged
IPropertyChanged
INotifyDataChanged
IDataProperty
Answer: A) INotifyPropertyChanged
Explanation:
INotifyPropertyChanged allows a data source to notify the binding system when a property value changes.
25. Which Silverlight feature allows controls to share predefined property settings?
- Styles
- Sessions
- Triggers only
- Routes
Answer: A) Styles
Explanation:
Styles provide reusable property settings that can be applied to multiple controls or elements.
26. Which XAML element is commonly used to define reusable resources such as styles?
Resources
StylesOnly
Definitions
SharedObjects
Answer: A) Resources
Explanation:
Resource dictionaries can contain reusable objects such as styles, brushes, and other resources.
27. Which Silverlight feature is used to change the visual appearance or behavior of a control?
- ControlTemplate
- DataTable
- HttpHandler
- AssemblyInfo
Answer: A) ControlTemplate
Explanation:
A ControlTemplate defines the visual structure and behavior of a control's presentation.
28. Which Silverlight class is used as a base for controls that display content?
ContentControl
ContentWindow
ContentPanel
ContentHost
Answer: A) ContentControl
Explanation:
ContentControl is a control base class for controls whose primary purpose is to display content.
29. Which Silverlight class is commonly used as the root container for a page?
UserControl
PageHost
WindowControl
RootPage
Answer: A) UserControl
Explanation:
A Silverlight XAML page commonly derives from UserControl, providing a reusable container for the page's visual tree.
30. Which Silverlight control is commonly used to display a collection of selectable items?
ListBox
TextBlock
Border
Canvas
Answer: A) ListBox
Explanation:
ListBox displays a collection of items and allows users to select items from the collection.
31. Which Silverlight control is designed to allow selection from a drop-down list?
ComboBox
DropDownPanel
SelectBox
ChoiceList
Answer: A) ComboBox
Explanation:
ComboBox provides a drop-down interface for selecting an item from a collection.
32. Which class is used to define a sequence of animation operations in Silverlight?
Storyboard
AnimationSequence
TimelineGroup
MotionController
Answer: A) Storyboard
Explanation:
A Storyboard controls and coordinates animations over time in Silverlight.
33. Which animation changes a numerical property from one value to another over time?
DoubleAnimation
NumberAnimation
ValueAnimation
NumericTransition
Answer: A) DoubleAnimation
Explanation:
DoubleAnimation animates a property whose value is represented by a double-precision floating-point number.
34. Which animation is used to animate a color value in Silverlight?
ColorAnimation
BrushAnimation
RGBAnimation
ColorTransition
Answer: A) ColorAnimation
Explanation:
ColorAnimation interpolates between color values during an animation.
35. Which Silverlight element can be used to play audio or video media?
MediaElement
MediaPlayerControl
VideoElement
AudioElement
Answer: A) MediaElement
Explanation:
MediaElement provides media playback capabilities in Silverlight applications.
36. Which method is commonly used to start playback of a Silverlight MediaElement?
Play()
StartMedia()
BeginPlay()
Run()
Answer: A) Play()
Explanation:
The Play() method starts playback of media loaded by a MediaElement.
37. Which Silverlight class was used for navigating between application pages?
NavigationService
PageRouter
NavigationManager
RouteController
Answer: A) NavigationService
Explanation:
Silverlight navigation applications used NavigationService to navigate between pages and manage navigation-related operations.
38. Which method is commonly used to navigate to another URI using Silverlight navigation?
Navigate()
GoTo()
OpenPage()
Route()
Answer: A) Navigate()
Explanation:
The Navigate() method was used by Silverlight navigation services to navigate to a specified URI.
39. Which Silverlight feature provides isolated client-side storage for application data?
- Isolated Storage
- Shared Storage
- Browser Registry
- Local SQL Server
Answer: A) Isolated Storage
Explanation:
Silverlight applications could use isolated storage to persist application-specific data in a storage area separated from other applications.
40. Which namespace contains the Silverlight isolated storage classes?
System.IO.IsolatedStorage
System.Storage.Silverlight
System.Web.Storage
Microsoft.Silverlight.Storage
Answer: A) System.IO.IsolatedStorage
Explanation:
Silverlight isolated storage APIs were provided through the System.IO.IsolatedStorage namespace.
41. Which class represents an isolated storage area for an application?
IsolatedStorageFile
StorageFile
ApplicationStorage
LocalStorageFile
Answer: A) IsolatedStorageFile
Explanation:
IsolatedStorageFile provides access to an application's isolated file storage.
42. Which Silverlight feature was commonly used to communicate with web services asynchronously?
- WebClient or HTTP-based asynchronous APIs
- Direct SQL connections from the browser
- Windows Registry APIs
- Direct server memory access
Answer: A) WebClient or HTTP-based asynchronous APIs
Explanation:
Silverlight applications used asynchronous networking APIs such as WebClient and related HTTP mechanisms to communicate with remote services.
43. Why were asynchronous operations important in Silverlight applications?
- To avoid blocking the UI while waiting for network operations
- To compile XAML faster
- To increase the size of a XAP file
- To disable event handling
Answer: A) To avoid blocking the UI while waiting for network operations
Explanation:
Network and other long-running operations should be performed asynchronously so the application's UI remains responsive while the operation is in progress.
44. Which Silverlight feature provides a way to expose application commands and navigation behavior through browser integration?
- Deep linking
- Dependency injection
- SQL linking
- Assembly linking
Answer: A) Deep linking
Explanation:
Deep linking allowed a specific location or page within a Silverlight navigation application to be represented by a URL, making it possible to navigate directly to that location.
45. Which Silverlight feature allows controls to react to different visual states?
- VisualStateManager
- VisualController
- StateManagerService
- ControlStateEngine
Answer: A) VisualStateManager
Explanation:
VisualStateManager provides a mechanism for defining and transitioning between visual states of controls.
46. Which Silverlight concept allows the same UI control to have different visual appearances through templates?
- Control templating
- Database mapping
- Assembly loading
- Service routing
Answer: A) Control templating
Explanation:
Control templates separate the visual representation of a control from its functional behavior, allowing controls to be given customized appearances.
47. Which Silverlight element is commonly used to define a reusable resource dictionary at the application level?
Application.Resources
Application.DictionaryOnly
Application.StylesOnly
Application.Shared
Answer: A) Application.Resources
Explanation:
Application.Resources can contain resources that are available throughout the Silverlight application.
48. What does the following Silverlight XAML binding specify?
<TextBlock Text="{Binding Name}" />
- TextBlock.Text is bound to the Name property of the applicable data source
- The TextBlock creates a new property named Name
- The TextBlock changes the application's URL to Name
- The TextBlock disables data binding
Answer: A) TextBlock.Text is bound to the Name property of the applicable data source
Explanation:
The binding expression uses Name as its property path. The binding engine obtains that property from the applicable source, commonly through the element's DataContext.
49. What is the main purpose of the following Silverlight XAML code?
<Canvas>
<Rectangle Width="100"
Height="50"
Canvas.Left="20"
Canvas.Top="30" />
</Canvas>
- It positions a rectangle at coordinates within a Canvas
- It creates a data-bound rectangle
- It defines a Grid with two rows
- It creates a media player
Answer: A) It positions a rectangle at coordinates within a Canvas
Explanation:
The Rectangle is a child of a Canvas, and Canvas.Left and Canvas.Top specify its position relative to the Canvas.
50. A Silverlight application needs to display a customer's name from a C# object and automatically reflect changes when the object's Name property changes. Which approach is appropriate?
- Bind the TextBlock to Name and have the data object implement INotifyPropertyChanged
- Store the Name value only in a CSS file
- Use Canvas.Left to update the customer's name
- Place the Name value inside the XAP file and never update it
Answer: A) Bind the TextBlock to Name and have the data object implement INotifyPropertyChanged
Explanation:
A binding can connect the TextBlock's Text property to the object's Name property, while INotifyPropertyChanged allows the object to notify the binding system when Name changes. This enables the UI to receive property-change notifications without manually resetting the TextBlock value each time.
Advertisement
Advertisement