Exemple #1
0
        /// <summary>Loads the resources.</summary>
        protected override sealed void LoadResources()
        {
            var skinResolver = PreLoadResources();

            try
            {
                var skinBamlStreams = skinResolver.GetSkinBamlStreams(_fullName, _resourceName);
                foreach (var resourceStream in skinBamlStreams)
                {
                    var skinResource = BamlHelper.LoadBaml <ResourceDictionary>(resourceStream);
                    if (skinResource != null)
                    {
                        Resources.Add(skinResource);
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            finally
            {
                PostLoadResources();
            }
        }
        protected sealed override void LoadResources()
        {
            ISkinBamlResolver skinResolver = PreLoadResources();

            try
            {
                List <Stream> skinBamlStreams = skinResolver.GetSkinBamlStreams(_fullName, _resourceName);
                foreach (Stream resourceStream in skinBamlStreams)
                {
                    ResourceDictionary skinResource = BamlHelper.LoadBaml <ResourceDictionary>(resourceStream);
                    if (skinResource != null)
                    {
                        Resources.Add(skinResource);
                    }
                }
            }
            finally
            {
                PostLoadResources();
            }
        }