Silverlight XAML notes:

Via silverlight, UI is generated using an XML-based declarative language called XAML

Page.xaml contains the XAML code that defines the UI, while Page.xaml.cs contains the codebehind for the application. 

You can have only one Page.xaml.cs file, but you can have multiple XAML files that can be managed through the central Page.xaml file (You might do this if you want to manage separate Silverlight controls in one Page.xaml)


Dynamically apply and change Theme with the Silverlight Toolkit
This tutorial shows you how to Theme your Silverlight app and allow the user to switch Theme dynamically - i.e. user can right click and choose a Theme:

http://weblogs.asp.net/lduveau/archive/2010/05/31/dynamically-apply-and-change-theme-with-the-silverlight-toolkit.aspx

By "theme" we refer to color and how fields and buttons look.

Silverlight comes with 12 themes that can be included so your user can select at runtime AND you can also create your own.





Images with Silverlight and xaml:

http://forums.silverlight.net/forums/p/48611/128972.aspx

JPEG or PNG only

place in any folder, make that the folder to access from, so user can change if desired (or we can change as desired)



IF instead you build with image as "Resource", than the image is built right into the application (no separate folder and files)

http://nerddawg.blogspot.com/2008/03/silverlight-2-demystifying-uri.html

Looks like would use "Content" or "None" to make the images so they can be in separate folder instead of embedded in program file

***REFER TO:  http://msdn.microsoft.com/en-us/library/cc296240(v=vs.95).aspx

Resource. This build action will embed the file in the project assembly. You can use this option with application and library projects, and deploy the assemblies inside or outside the application package.

Content. This build action will include the file in the application package without embedding it in the project assembly. Use this option for resource files shared by multiple assemblies in the package. 

None. This build action will not include the file in the application package or assembly. Use this option for resource files that you want to retrieve on demand. You will typically deploy on-demand files at the same server location as your application package. 



What image format:

http://www.silverlight.net/learn/quickstarts/images/

Silverlight does not support all image formats. The BitmapImage can be used to reference images in the JPEG and PNG file formats. 

Definitely NOT gifs.

Still looking into about vector images


bmp: NOT SUPPORTED IN SILVERLIGHT 
No warning, no error, it just does not display the image 

jpg: It works, but does not support a transparent color 

gif: It supports a transparent color, but NOT SUPPORTED IN SILVERLIGHT 

png: It works AND it supports a transparent color 




still looking for confirmation about vector, svg, ico files - old posts say not supported, new posts seem to give the idea that it is supported

I found this from 2007:  http://weblogs.asp.net/jgalloway/archive/2007/06/05/silverlight-and-xaml-have-you-guys-met-old-man-svg.aspx

supposedly from posts to it, as of 2009 inkscape now directly supports saving to XAML 

there is also http://xamltune.codeplex.com/



****IF USING VECTOR IMAGES - http://stackoverflow.com/questions/2684895/icons-in-silverlight-images-vs-vectors

**Make sure to use CacheMode to at least reduce the level of math needed to handle the said graphics (given Silverlight doesn't use GPU and relies on software rendering to perform tasks like this).


Extensively beautiful, crisp, clear and stunning vector XAML icons for your WPF and Silverlight applications. You no longer have to worry about having to search for multiple folders for icon files at different sizes! Add high quality XAML vector icons to your WPF and Silverlight application and you will have the power to go "scalable vector style" all the way! XAML icons gives you the ability to resize icons in your silverlight or wpf applications to any size without any loss in quality or pixel distortions.

http://www.artistsvalley.com/xaml-icons/xaml-wpf-icons.html

supposedly I can convert vector images to xaml so they can be used with expression and silverlight.



*****************

Because Silverlight 4's support for implicit styling makes theming so much easier, the Theme base class has been enhanced and is now more useful than ever. For starters, there's a ThemeUri property which can point to an external file to use as the theme. This reference can be a URL for a web resource like /MySiteWideTheme.xaml which gives sites the freedom to change a theme after an application has been deployed. Or it can point to an assembly resource via the /AssemblyShortName;component/ResourceLocation syntax discussed here. In this second case, the theme is loaded immediately; otherwise it is downloaded asynchronously and applied as soon as the download completes. Even better, ThemeUri can be changed dynamically by applications that allow users to change their themes "on the fly". 

http://blogs.msdn.com/b/delay/archive/2010/04/15/alive-and-kickin-new-silverlight-4-toolkit-released-with-today-s-silverlight-4-rtw.aspx

The format of a theme file is exactly what you'd expect: a generic.xaml-like ResourceDictionary containing one or more implicit styles. This is how the Toolkit classes store their theme resources, so those themes are accessible in the same manner. This makes it easy to dynamically switch among any of the Toolkit themes, too! 

Okay, that's pretty cool and all, but sometimes you want to theme an entire application and you don't want to have to wrap every page in its own theme container. No sweat, that's what the new ApplicationThemeUri attached property is all about! Just open your project's App.xaml and set the ApplicationThemeUri property on the Application object (just as you would for ThemeUri on the Theme class). When ApplicationThemeUri is used, the corresponding implicit styles are added at the application level and automatically apply to every page. 

Can it get any easier? Yes! :) Every theme that comes with the Toolkit also exposes an IsApplicationTheme attached property. Much like ApplicationThemeUri, you set this property in App.xaml on the Application object. But because IsApplicationTheme is a simple bool value, you don't have to mess with ugly, confusing URI formats or even know what a URI is! Just set it (to True), and forget it! 


*****************

