ImageVisualProperty.WrapModeU,
ImageVisualProperty.WrapModeV,
ImageVisualProperty.SynchronousLoading,
+ Visual.Property.MixColor,
Visual.Property.PremultipliedAlpha,
ImageVisualProperty.OrientationCorrection,
ImageVisualProperty.FastTrackUploading,
}
}
+ /// <summary>
+ /// The mixed color value for the image.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// The property cascade chaining set is not recommended.
+ /// </para>
+ /// </remarks>
+ /// <example>
+ /// This way is recommended for setting the property
+ /// <code>
+ /// var imageView = new ImageView();
+ /// imageView.ImageColor = new Color(0.5f, 0.1f, 0.0f, 1.0f);
+ /// </code>
+ /// This way to set the property is prohibited
+ /// <code>
+ /// imageView.ImageColor.R = 0.5f; //This does not guarantee a proper operation
+ /// </code>
+ /// </example>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Color ImageColor
+ {
+ get
+ {
+ return (Color)GetValue(ImageColorProperty);
+ }
+ set
+ {
+ SetValue(ImageColorProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
internal Selector<string> ResourceUrlSelector
{
get => GetSelector<string>(resourceUrlSelector, ImageView.ResourceUrlProperty);
var imageView = (ImageView)bindable;
return Object.InternalGetPropertyBool(imageView.SwigCPtr, ImageView.Property.TransitionEffect);
}));
+
+ /// <summary>
+ /// ImageColorProperty
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty ImageColorProperty = BindableProperty.Create(nameof(ImageColor), typeof(Color), typeof(ImageView), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var imageView = (ImageView)bindable;
+ if (newValue != null)
+ {
+ imageView.UpdateImage(Visual.Property.MixColor, new PropertyValue((Color)newValue));
+ }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var imageView = (ImageView)bindable;
+ Color ret = new Color();
+
+ imageView.GetCachedImageVisualProperty(Visual.Property.MixColor)?.Get(ret);
+
+ return ret;
+ });
}
}