private static Storyboard GetStoryboard(string name)
{
if (_storyboardXamlCache == null)
{
_storyboardXamlCache = new Dictionary<string, string>();
}
string xaml = null;
if (_storyboardXamlCache.ContainsKey(name))
{
xaml = _storyboardXamlCache[name];
}
else
{
string path = "/Ch.Epix.WindMobile.WP7;component/View/Transition/Storyboard/" + name + ".xaml";
Uri uri = new Uri(path, UriKind.Relative);
StreamResourceInfo streamResourceInfo = Application.GetResourceStream(uri);
using (StreamReader streamReader = new StreamReader(streamResourceInfo.Stream))
{
xaml = streamReader.ReadToEnd();
_storyboardXamlCache[name] = xaml;
}
}
return XamlReader.Load(xaml) as Storyboard;
}