Thoughts about application packaging, Resources, MVVM and others

Sunday, October 24, 2010

I thought a lot before decided to write this post… First - I’d like to thanks Ariel Ben Horesh for “inspiring” me to write this post and for dedicating so much time to write his post! After reading his post I thought a lot and my thoughts about the post are the follows: 1. First, I thought about the applications and the way to provide user with best experience while loading those applications… The users shouldn’t wait minutes for application to download… While authoring large Silverlight applications (MVVM or not) the author should consider to split...

Silverlight Tip: Enumerating embedded resources

Friday, November 13, 2009

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...

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

Wednesday, October 21, 2009

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 some Boolean value to string representation and for...

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

Tuesday, July 14, 2009

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 change the cultures (or at least I didn’t found them). So the only way (for me) to...

Silverlight 3 Quick Tip #10: Styling Improvements

Monday, June 22, 2009

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" Value="100"/> <Setter Property="Height" Value="25"/> <Setter Property="Margin" Value="5"/> </Style> To “derive” from existing style we should specify BasedOn property <Style x:Key="DerivedButtonStyle" TargetType="ButtonBase" BasedOn="{StaticResource BaseButtonStyle}"> ...