/// <summary> /// Helper method to serialize <see cref="ImageSource" /> objects. /// </summary> public static AttributeValueHolder ImageSourceToDelegate(ImageSource imageSource) { if (imageSource is null) { throw new ArgumentNullException(nameof(imageSource)); } return(AttributeValueHolderFactory.FromObject(imageSource)); }
/// <summary> /// Helper method to serialize objects. /// </summary> public static AttributeValueHolder ObjectToDelegate(object value) { if (value is null) { throw new ArgumentNullException(nameof(value)); } return(AttributeValueHolderFactory.FromObject(value)); }
/// <summary> /// Helper method to deserialize <see cref="ImageSource" /> objects. /// </summary> public static ImageSource DelegateToImageSource(object imageSource, ImageSource defaultValueIfNull = default) { return(AttributeValueHolderFactory.ToValue <ImageSource>(imageSource, defaultValueIfNull)); }
/// <summary> /// Helper method to deserialize objects. /// </summary> public static T DelegateToObject <T>(object value, T defaultValueIfNull = default) { return(AttributeValueHolderFactory.ToValue <T>(value, defaultValueIfNull)); }