|
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Diagnostics;
namespace Tomers.WPF.Themes.Skins
{
public sealed class LooseXamlSkin : Skin
{
public LooseXamlSkin(string name, Uri source) : base (name)
{
this._sources = new List<Uri>();
this._sources.Add(source);
}
public LooseXamlSkin(string name, IList<Uri> sources) : base (name)
{
this._sources = new List<Uri>(sources);
}
protected override void LoadResources()
{
foreach (Uri uri in _sources)
{
ResourceDictionary skinDictionary = new ResourceDictionary();
try
{
skinDictionary.Source = uri;
}
catch (Exception ex)
{
Debug.WriteLine("Change error: " + ex.ToString());
throw;
}
Resources.Add(skinDictionary);
}
}
private readonly List<Uri> _sources;
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Tomer Shamam is a Software Architect and a UI Expert at CodeValue, the home of software experts, based in Israel (http://codevalue.net). Tomer is a speaker in Microsoft conferences and user groups, and in-house courses. Tomer has years of experience in software development, he holds a B.A degree in computer science, and his writings appear regularly in the Israeli MSDN Pulse, and other popular developer web sites such as CodePlex and The Code Project. About his thoughts and ideas you can read in his blog (http://blogs.microsoft.co.il/blogs/tomershamam).