/// <summary>
        /// When implemented in a derived class, returns an object that is set as the value of the target property for this markup extension.
        /// </summary>
        /// <param name="serviceProvider">
        /// Object that can provide services for the markup extension.
        /// </param>
        /// <returns>
        /// The object value to set on the property where the extension is applied.
        /// </returns>
        public override object ProvideValue(IServiceProvider serviceProvider)
        {
            if (this.IsEmissive)
            {
                return(MaterialHelper.CreateEmissiveImageMaterial(this.path, Brushes.Black, this.UriKind));
            }

            return(MaterialHelper.CreateImageMaterial(this.path, this.Opacity, this.UriKind));
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MapTexture"/> class.
 /// </summary>
 /// <param name="source">
 /// The source.
 /// </param>
 public MapTexture(string source)
 {
     this.Material = MaterialHelper.CreateImageMaterial(source, 1);
 }