Пример #1
0
        /// <summary>
        ///     Load specific property from storage.
        /// </summary>
        /// <remarks>
        ///     Override if you need to manually control the way some properties are loaded from storage.
        /// </remarks>
        protected virtual void LoadPropertyFromStorage(IConfigurationService configurationService, String configurationKey, PropertyData propertyData)
        {
            var objectConverterService = this.GetDependencyResolver().Resolve <IObjectConverterService>();

            Object value = configurationService.GetRoamingValue(configurationKey, propertyData.GetDefaultValue());

            if (value is String stringValue)
            {
                value = objectConverterService.ConvertFromStringToObject(stringValue, propertyData.Type, CultureInfo.InvariantCulture);
            }

            SetValue(propertyData, value);
        }