Exemplo n.º 1
0
		private void RaiseValueDeleteInteractionRequest(PropertyValueBase item)
		{
			var confirmation = new ConditionalConfirmation
			{
				Content = string.Format("Are you sure you want to delete dictionary Property value '{0}'?", item),
				Title = "Delete confirmation"
			};

			CommonConfirmRequest.Raise(confirmation, (x) =>
			{
				if (x.Confirmed)
				{
					InnerItem.PropertyValues.Remove((PropertyValue)item);
				}
			});
		}
Exemplo n.º 2
0
		private void RaiseValueEditInteractionRequest(PropertyValueBase originalItem)
		{
			var item = originalItem.DeepClone(_entityFactory as CatalogEntityFactory);
			if (RaisePropertyValueEditInteractionRequest(item, "Edit property value"))
			{
				// copy all values to original:
				OnUIThread(() => originalItem.InjectFrom<CloneInjection>(item));
				// fake assign for UI triggers to display correct values.
				originalItem.ValueType = item.ValueType;
			}
		}
Exemplo n.º 3
0
 /// <summary>
 /// Creates the property value model.
 /// </summary>
 /// <param name="value">The value.</param>
 /// <param name="property">The property.</param>
 /// <returns>PropertyValueModel.</returns>
 public static PropertyValueModel CreatePropertyValueModel(PropertyValueBase value, Property property)
 {
     if (property.IsEnum && !string.IsNullOrEmpty(value.KeyValue))
     {
         return CreatePropertyValueModel(property.PropertyValues.First(p => p.PropertyValueId == value.KeyValue));
     }
     return CreatePropertyValueModel(value);
 }
Exemplo n.º 4
0
        /// <summary>
        /// Creates the property value model.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns>PropertyValueModel.</returns>
        /// <exception cref="System.ArgumentNullException">value</exception>
        public static PropertyValueModel CreatePropertyValueModel(PropertyValueBase value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            var model = new PropertyValueModel();
            model.InjectFrom<CloneInjection>(value);
            return model;
        }
Exemplo n.º 5
0
        /// <summary>
        /// Creates the property model.
        /// </summary>
        /// <param name="priority">The priority.</param>
        /// <param name="property">The property.</param>
        /// <param name="value">The value.</param>
        /// <param name="item">The item.</param>
        /// <returns>PropertyModel.</returns>
        /// <exception cref="System.ArgumentNullException">property</exception>
        public static PropertyModel CreatePropertyModel(int priority, Property property, PropertyValueBase value, StorageEntity item)
        {
            if (property == null)
            {
                throw new ArgumentNullException("property");
            }

            var model = new PropertyModel { Priority = priority };
            model.InjectFrom<CloneInjection>(property);
            model.Values = new[] { CreatePropertyValueModel(value, property) };
            model.CatalogItem = item;
            return model;
        }