Your SlideShare is downloading. ×
  • Like
Resources and styles
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.


Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Resources and styles



Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads


Total Views
On SlideShare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. Resource File and Styling in SL
    Senior Software Engineer
    United Health Group
  • 2. Mahender Sarangam
    Having 5 years of experience on .NET Technologies. Working as a Senior Software Engineer in United Health Group (UHG India Information Service Ltd.). Worked with Big Firms like Deloitte Consulting & Wipro Technology.
    Got Technical Acquaintance on Technologies like C#, ASP.NET,AJAX, LINQ, Silverlight, WPF,WCF ,SQL Server, Team Foundation Server(TFS) and SharePoint Technology.
    MCTS Certified in Web Technologies.
    Blog :
  • 3. What are Resource File
    In Today Applications, resource places a important role in application development. Resource File may be any Images, Language specific RESX file, Audio, video
    Reason for Resource Files
    Reuse objects
    Centralize details
    Create non visual objects
    In Silverlight, Resources can be managed in the following ways:
    Loading on Demand
    Resource embedded inside XAP/Assembly
    Resources from external assemblies
  • 4. When we add Resource File to Silver Light Client project, How to deploy the resource file
    With the help of Build Action property in Visual Studio , Mode of Deployment is decided
    Marking BUILD Action as Resource, Content and None
    When Build action is Resource ,Then Image file is embedded within Silverlight dll. Size of dll will be more.
    When it is Content, Resource file will be part of XAP
    When it is NONE, then we need to manually copy the resource file under ClientBin folder
    Need to call resource from other silverlight library , we can refer like “/assemblyName;component/Location”
  • 5. Resources must be defined within an appropriately named collection called Resources.
    This collection is a ResourceDictionary, a specialized dictionary containing resources identified by implicit or explicit keys
    A merged resource dictionary enables you to declare the contents of a resource dictionary by referencing an external file, and to use the externally defined resources to augment the resources found in an existing FrameworkElement.Resources property location
  • 6. Styles are extremely important because they allow developers to control the look and layout of controls across their application.
    This is a much faster alternative to updating each and every control in your application individually.
    A style resource in Silverlight is a way to create reusable properties for various controls.
    Styles in Silverlight are powerful mechanisms that allow controlling the visual representation of elements in a unified way /consistent look for all user interface elements.
    Each Silverlight element has a series of attributes that you set to make a style for an element.
  • 7. Styles as a resource
    You can declare it at User Control level where it is accessible to only the element on that User Control. 
    You can define it at application level and have the style available to the whole application. 
    You can also define the style in a resource dictionary and have that accessible to the whole application
    Application Level Resources: Applies style to Global level i.e. at application Level.
    Style customTextBlockStyle = Resources["StyledTextbox"] as Style;
  • 8. Cascading Styles:
    you can build a powerful and reusable set of styles to apply in your Silverlight applications
    <Style x:Key="LargerStyledTextbox" TargetType="TextBox"
    <Setter Property="FontSize" Value="25"/>
    Merged Dictionaries
  • 9. <UserControl.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="..." /> <ResourceDictionary Source="..." /> <ResourceDictionary Source="..." /> </ResourceDictionary.MergedDictionaries> </ResourceDictionary></UserControl.Resources>
  • 10. Thank you