using System; using System.Collections.Generic; namespace Xamarin.Forms { static class ResourcesExtensions { public static IEnumerable> GetMergedResources(this IElement element) { Dictionary resources = null; while (element != null) { var ve = element as IResourcesProvider; if (ve != null && ve.Resources != null) { resources = resources ?? new Dictionary(); foreach (KeyValuePair res in ve.Resources.MergedResources) if (!resources.ContainsKey(res.Key)) resources.Add(res.Key, res.Value); else if (res.Key.StartsWith(Style.StyleClassPrefix, StringComparison.Ordinal)) { var mergedClassStyles = new List