[NUI] Modify Resources to XamlResources (#327)
authorhuiyueun <35286162+huiyueun@users.noreply.github.com>
Mon, 9 Jul 2018 02:58:52 +0000 (11:58 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Mon, 9 Jul 2018 02:58:52 +0000 (11:58 +0900)
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/Tizen.NUI/src/internal/Application.cs
src/Tizen.NUI/src/internal/Xaml/MarkupExtensions/StaticResourceExtension.cs
src/Tizen.NUI/src/internal/XamlBinding/Application.cs
src/Tizen.NUI/src/internal/XamlBinding/ResourcesExtensions.cs
src/Tizen.NUI/src/internal/XamlBinding/StyleSheets/StyleSheetExtensions.cs
src/Tizen.NUI/src/public/BaseComponents/View.cs
src/Tizen.NUI/src/public/XamlBinding/ContentPage.cs
src/Tizen.NUI/src/public/XamlBinding/IResourcesProvider.cs

index aefdfc2..a12a278 100755 (executable)
@@ -459,7 +459,7 @@ namespace Tizen.NUI
             }
         }
 
-        public ResourceDictionary Resources
+        public ResourceDictionary XamlResources
         {
             get
             {
@@ -578,7 +578,7 @@ namespace Tizen.NUI
 
         internal override void OnParentResourcesChanged(IEnumerable<KeyValuePair<string, object>> values)
         {
-            if (!((IResourcesProvider)this).IsResourcesCreated || Resources.Count == 0)
+            if (!((IResourcesProvider)this).IsResourcesCreated || XamlResources.Count == 0)
             {
                 base.OnParentResourcesChanged(values);
                 return;
@@ -586,7 +586,7 @@ namespace Tizen.NUI
 
             var innerKeys = new HashSet<string>();
             var changedResources = new List<KeyValuePair<string, object>>();
-            foreach (KeyValuePair<string, object> c in Resources)
+            foreach (KeyValuePair<string, object> c in XamlResources)
                 innerKeys.Add(c.Key);
             foreach (KeyValuePair<string, object> value in values)
             {
index f0ddb68..9218b4c 100755 (executable)
@@ -30,7 +30,7 @@ namespace Tizen.NUI.Xaml
 
             foreach (var p in valueProvider.ParentObjects) {
                 var irp = p as IResourcesProvider;
-                var resDict = irp != null && irp.IsResourcesCreated ? irp.Resources : p as ResourceDictionary;
+                var resDict = irp != null && irp.IsResourcesCreated ? irp.XamlResources : p as ResourceDictionary;
                 if (resDict == null)
                     continue;
                 if (resDict.TryGetValue(Key, out resource))
@@ -83,7 +83,7 @@ namespace Tizen.NUI.Xaml
         internal object GetApplicationLevelResource(string key, IXmlLineInfo xmlLineInfo)
         {
             object resource = null;
-            if (Application.Current == null || !((IResourcesProvider)Application.Current).IsResourcesCreated || !Application.Current.Resources.TryGetValue(Key, out resource))
+            if (Application.Current == null || !((IResourcesProvider)Application.Current).IsResourcesCreated || !Application.Current.XamlResources.TryGetValue(Key, out resource))
                 throw new XamlParseException($"StaticResource not found for key {Key}", xmlLineInfo);
             return resource;
         }
index f770ce4..83520a2 100755 (executable)
@@ -135,7 +135,7 @@ namespace Tizen.NUI.Binding
         ResourceDictionary _resources;
         bool IResourcesProvider.IsResourcesCreated => _resources != null;
 
-        public ResourceDictionary Resources
+        public ResourceDictionary XamlResources
         {
             get
             {
@@ -251,7 +251,7 @@ namespace Tizen.NUI.Binding
 
         internal override void OnParentResourcesChanged(IEnumerable<KeyValuePair<string, object>> values)
         {
-            if (!((IResourcesProvider)this).IsResourcesCreated || Resources.Count == 0)
+            if (!((IResourcesProvider)this).IsResourcesCreated || XamlResources.Count == 0)
             {
                 base.OnParentResourcesChanged(values);
                 return;
@@ -259,7 +259,7 @@ namespace Tizen.NUI.Binding
 
             var innerKeys = new HashSet<string>();
             var changedResources = new List<KeyValuePair<string, object>>();
-            foreach (KeyValuePair<string, object> c in Resources)
+            foreach (KeyValuePair<string, object> c in XamlResources)
                 innerKeys.Add(c.Key);
             foreach (KeyValuePair<string, object> value in values)
             {
index 58664cd..84eeaf3 100755 (executable)
@@ -14,7 +14,7 @@ namespace Tizen.NUI.Binding
                 if (ve != null && ve.IsResourcesCreated)
                 {
                     resources = resources ?? new Dictionary<string, object>();
-                    foreach (KeyValuePair<string, object> res in ve.Resources.MergedResources)
+                    foreach (KeyValuePair<string, object> res in ve.XamlResources.MergedResources)
                         if (!resources.ContainsKey(res.Key))
                             resources.Add(res.Key, res.Value);
                         else if (res.Key.StartsWith(Style.StyleClassPrefix, StringComparison.Ordinal))
@@ -48,7 +48,7 @@ namespace Tizen.NUI.Binding
             while (element != null)
             {
                 var ve = element as IResourcesProvider;
-                if (ve != null && ve.IsResourcesCreated && ve.Resources.TryGetValue(key, out value))
+                if (ve != null && ve.IsResourcesCreated && ve.XamlResources.TryGetValue(key, out value))
                     return true;
                 var app = element as Application;
                 if (app != null && app.SystemResources != null && app.SystemResources.TryGetValue(key, out value))
@@ -57,7 +57,7 @@ namespace Tizen.NUI.Binding
             }
 
             //Fallback for the XF previewer
-            if (Application.Current != null && ((IResourcesProvider)Application.Current).IsResourcesCreated && Application.Current.Resources.TryGetValue(key, out value))
+            if (Application.Current != null && ((IResourcesProvider)Application.Current).IsResourcesCreated && Application.Current.XamlResources.TryGetValue(key, out value))
                 return true;
 
             value = null;
index 51124a8..508de0a 100755 (executable)
@@ -9,9 +9,9 @@ namespace Tizen.NUI.StyleSheets
         {
             if (!resourcesProvider.IsResourcesCreated)
                 yield break;
-            if (resourcesProvider.Resources.StyleSheets == null)
+            if (resourcesProvider.XamlResources.StyleSheets == null)
                 yield break;
-            foreach (var styleSheet in resourcesProvider.Resources.StyleSheets)
+            foreach (var styleSheet in resourcesProvider.XamlResources.StyleSheets)
                 yield return styleSheet;
         }
     }
index 3c38fda..32eadac 100755 (executable)
@@ -39,15 +39,15 @@ namespace Tizen.NUI.BaseComponents
 
         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public ResourceDictionary Resources
+        public ResourceDictionary XamlResources
         {
             get
             {
-                return Application.Current.Resources;
+                return Application.Current.XamlResources;
             }
             set
             {
-                Application.Current.Resources = value;
+                Application.Current.XamlResources = value;
             }
         }
 
index 139355b..054843c 100755 (executable)
@@ -127,16 +127,16 @@ namespace Tizen.NUI
         /// </summary>
         /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
-        public ResourceDictionary Resources
+        public ResourceDictionary XamlResources
         {
             get
             {
-                return Application.Current.Resources;
+                return Application.Current.XamlResources;
             }
 
             set
             {
-                Application.Current.Resources = value;
+                Application.Current.XamlResources = value;
             }
         }
 
index baf87cb..243b6b7 100755 (executable)
@@ -7,6 +7,6 @@ namespace Tizen.NUI.Binding
     public interface IResourcesProvider
     {
         bool IsResourcesCreated { get; }
-        ResourceDictionary Resources { get; set; }
+        ResourceDictionary XamlResources { get; set; }
     }
 }