зеркало из https://github.com/DeGsoft/maui-linux.git
This commit is contained in:
Родитель
0efd26cb30
Коммит
fff5b25a1f
|
@ -15,14 +15,19 @@ namespace Xamarin.Forms
|
|||
{
|
||||
resources = resources ?? new Dictionary<string, object>();
|
||||
foreach (KeyValuePair<string, object> res in ve.Resources.MergedResources)
|
||||
if (!resources.ContainsKey(res.Key))
|
||||
resources.Add(res.Key, res.Value);
|
||||
{
|
||||
// If a MergedDictionary value is overridden for a DynamicResource,
|
||||
// it comes out later in the enumeration of MergedResources
|
||||
// TryGetValue ensures we pull the up-to-date value for the key
|
||||
if (!resources.ContainsKey(res.Key) && ve.Resources.TryGetValue(res.Key, out object value))
|
||||
resources.Add(res.Key, value);
|
||||
else if (res.Key.StartsWith(Style.StyleClassPrefix, StringComparison.Ordinal))
|
||||
{
|
||||
var mergedClassStyles = new List<Style>(resources[res.Key] as List<Style>);
|
||||
mergedClassStyles.AddRange(res.Value as List<Style>);
|
||||
resources[res.Key] = mergedClassStyles;
|
||||
}
|
||||
}
|
||||
}
|
||||
var app = element as Application;
|
||||
if (app != null && app.SystemResources != null)
|
||||
|
|
Загрузка…
Ссылка в новой задаче