summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2016-04-18 18:31:48 +0200
committerRui Marinho <me@ruimarinho.net>2016-04-18 17:31:48 +0100
commit9c005f30227eaf0d3aa7d253a7c3a9ea427c91c2 (patch)
tree6e261e80af1bfa70feeecb07ac0762c8fdee2382 /Xamarin.Forms.Core
parent4d279db34812891975aa0e8d73e3d5dd970a692c (diff)
downloadxamarin-forms-9c005f30227eaf0d3aa7d253a7c3a9ea427c91c2.tar.gz
xamarin-forms-9c005f30227eaf0d3aa7d253a7c3a9ea427c91c2.tar.bz2
xamarin-forms-9c005f30227eaf0d3aa7d253a7c3a9ea427c91c2.zip
[C] Allow implicit styles and DynamicResources in shared RD (#104)
Diffstat (limited to 'Xamarin.Forms.Core')
-rw-r--r--Xamarin.Forms.Core/ResourceDictionary.cs10
1 files changed, 7 insertions, 3 deletions
diff --git a/Xamarin.Forms.Core/ResourceDictionary.cs b/Xamarin.Forms.Core/ResourceDictionary.cs
index 7460a909..bff6127b 100644
--- a/Xamarin.Forms.Core/ResourceDictionary.cs
+++ b/Xamarin.Forms.Core/ResourceDictionary.cs
@@ -23,6 +23,7 @@ namespace Xamarin.Forms
return;
_mergedInstance = _mergedWith.GetTypeInfo().BaseType.GetTypeInfo().DeclaredMethods.First(mi => mi.Name == "GetInstance").Invoke(null, new object[] {_mergedWith}) as ResourceDictionary;
+ OnValuesChanged (_mergedInstance.ToArray());
}
}
@@ -64,7 +65,7 @@ namespace Xamarin.Forms
public int Count
{
- get { return _innerDictionary.Count; }
+ get { return _innerDictionary.Count + (_mergedInstance != null ? _mergedInstance.Count: 0); }
}
bool ICollection<KeyValuePair<string, object>>.IsReadOnly
@@ -116,12 +117,15 @@ namespace Xamarin.Forms
IEnumerator IEnumerable.GetEnumerator()
{
- return ((IEnumerable)_innerDictionary).GetEnumerator();
+ return GetEnumerator();
}
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
{
- return _innerDictionary.GetEnumerator();
+ var rd = (IEnumerable<KeyValuePair<string,object>>)_innerDictionary;
+ if (_mergedInstance != null)
+ rd = rd.Concat(_mergedInstance._innerDictionary);
+ return rd.GetEnumerator();
}
public bool TryGetValue(string key, out object value)