In the first part of this article series, we focused on learning the skills required for the layout-related questions and topics in the Silverlight exam (70-506). We looked at the layout containers (such as the Grid and the ScrollViewer), the basic controls (such as the TextBlock, CheckBox and the Button), how to create user controls, the navigation framework, displaying collections in controls such as the ListBox and finally at how the MediaElement can be used to playback media.
In this part, we’ll stay in the say theme let’s say: we’ll look at Enhancing the User Interface. We’ll be covering styling, templating, visual state manager, animations and more. For your convenience, the following list contains links to the other parts of the article series which have been finished already:
Since Silverlight is the platform of choice for building rich internet applications (RIAs), building a basic interface with just plain buttons and no animations seems like under-using the capabilities. Silverlight has many capabilities on board to help us create a unique experience, tailored to the business needs. Customizing the application’s UI has never been easier, since several features inside Silverlight are just targeted at doing so. In this part, we’ll look at how we can customize the UI of the application, so that our application can really shine!
Create or modify control styles
When we start creating a Silverlight application, we’re tempted to place UI-related properties directly on the elements themselves. Properties like FontSize, Width and Fill are often created on the declaration of the element in any XAML file. While there’s nothing really wrong with this way of working, it can become a difficult task to manage this in a later phase. Assume you have created an application for a company that has blue as its branding color. At some point, they want to update their logos and colors and everything needs to become red. You as the developer need to go through all the code files to make the changes directly in all XAML files. It will take some time.
For this very purpose, styles exist. Similar to CSS styling in HTML, styles in Silverlight are a way to create a common location for UI-related properties. A style also promotes reusability: when using the same style in all views, a simple change to that style changes all views without any manual change in the views themselves.
Read more: Silverlight Show
In this part, we’ll stay in the say theme let’s say: we’ll look at Enhancing the User Interface. We’ll be covering styling, templating, visual state manager, animations and more. For your convenience, the following list contains links to the other parts of the article series which have been finished already:
- Laying Out a User Interface (15%)
- Enhancing the User Interface (14%) (this part)
- Implementing Application Logic (16%)
- Working with Data (17%)
- Interacting with a Host Platform (11%)
- Structuring Applications (13%)
- Deploying Applications (13%)
Since Silverlight is the platform of choice for building rich internet applications (RIAs), building a basic interface with just plain buttons and no animations seems like under-using the capabilities. Silverlight has many capabilities on board to help us create a unique experience, tailored to the business needs. Customizing the application’s UI has never been easier, since several features inside Silverlight are just targeted at doing so. In this part, we’ll look at how we can customize the UI of the application, so that our application can really shine!
Create or modify control styles
When we start creating a Silverlight application, we’re tempted to place UI-related properties directly on the elements themselves. Properties like FontSize, Width and Fill are often created on the declaration of the element in any XAML file. While there’s nothing really wrong with this way of working, it can become a difficult task to manage this in a later phase. Assume you have created an application for a company that has blue as its branding color. At some point, they want to update their logos and colors and everything needs to become red. You as the developer need to go through all the code files to make the changes directly in all XAML files. It will take some time.
For this very purpose, styles exist. Similar to CSS styling in HTML, styles in Silverlight are a way to create a common location for UI-related properties. A style also promotes reusability: when using the same style in all views, a simple change to that style changes all views without any manual change in the views themselves.
Read more: Silverlight Show