Resource - DevCorner

Browse by Tags

All Tags » Resource (RSS)

Silverlight Tip: Enumerating embedded resources

Today I’ve got a “Call for Help” from one of Silverlight MVPs – Bill Reiss . The mail said: “I would like to enumerate all items that were marked as Content or Resource in the main XAP file. If I can’t do both I’d settle for one. Any sample code for this would be greatly appreciated. Bill”   I decided to help with embedded resources, because I did something like this in WPF. I’ve created sample application, which will display a list of resources in list box – from here it is very easy to use...

Silverlight Quick Tip: How to get localized resources from RESX file in code behind

It looks like I’m using too much resources and localizing too much applications lately :) This time I’ll show how to use localized resources from the RESX files. Here I already explained how to create the RESX files for Silverlight (by the way the article is relevant also for Visual Studio 2010 Beta 2 & Silverlight 3), and how to use those resources from XAML. In some cases, though, it is needed to use those resources from code behind. In my scenario I had to create value converter, which converts...

Silverlight Quick Tip: Resources in RESX files – Image Resources for Localization

This post was actually born in the middle of previous post :) I had to find the way to use images as a RESX resources – this actually was second question of the person who asked me about forcing the rebinding . Before starting, some theory about RESX usage in Silverlight. Silverlight support usage of RESX files and localization via “SupportedCultures” attribute in CSPROJ file. The attribute itself even exists in project created with Silverlight 3 Tools, but for some reason there is no interface to...

Silverlight 3 Quick Tip #10: Styling Improvements

Silverlight 3 bring long-awaited improvements in styling mechanism: “BasedOn” mechanism, Merged Resource Dictionaries and eliminates “write once” style setting behavior. Let’s see those features. BasedOn Styles can be “derived” from one another. Perfect for cascading/inheriting styles. Let’s define style for a… Button (well, in demos it is always a Button, TextBox, etc. ;)) < Style x : Key ="BaseButtonStyle" TargetType ="ButtonBase"> < Setter Property ="Width"...