From 835c954453462ff96ea873bfdee4f97f73913988 Mon Sep 17 00:00:00 2001 From: chanywa Date: Mon, 26 Jun 2017 09:49:52 +0900 Subject: [PATCH] Fix Properties of SearchPreference didn't work Change-Id: I172590eff8b2f8397d656fbb432f3b13d5d3af17 --- src/Tizen.Maps/Tizen.Maps/SearchPreference.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/Tizen.Maps/Tizen.Maps/SearchPreference.cs b/src/Tizen.Maps/Tizen.Maps/SearchPreference.cs index 731358f..ca57349 100755 --- a/src/Tizen.Maps/Tizen.Maps/SearchPreference.cs +++ b/src/Tizen.Maps/Tizen.Maps/SearchPreference.cs @@ -25,7 +25,7 @@ namespace Tizen.Maps public class SearchPreference : IGeocodePreference, IPlaceSearchPreference, IRouteSearchPreference, IDisposable { internal Interop.PreferenceHandle handle; - private IReadOnlyDictionary _properties = new Dictionary(); + private IDictionary _properties = new Dictionary(); /// /// Constructors a new search preference. @@ -117,12 +117,21 @@ namespace Tizen.Maps { get { - return _properties; + Action action = (key, value) => + { + _properties[key] = value; + }; + + handle.ForeachProperty(action); + return (IReadOnlyDictionary)_properties; } set { - Log.Info(string.Format("Properties is changed from {0} to {1}", Properties.ToString(), value.ToString())); - _properties = value; + foreach (var prop in value) + { + handle.SetProperty(prop.Key, prop.Value); + Log.Info(string.Format("Properties is changed to [{0}, {1}]", prop.Key, prop.Value)); + } } } -- 2.7.4