private IImageRenderElement CreateRenderElement(IRenderElementFactory factory) { IImageRenderElement imageRenderElement = factory.CreateImageRenderElement(this); if (Source != null) { imageRenderElement.Bounds = GetStretchRect(Source.Size, VisualBounds.Size, Stretch, StretchDirection); imageRenderElement.Source = this.Source; } return(imageRenderElement); }
protected override object CreateRenderElementContentOverride(IRenderElementFactory factory) { if (imageRenderElement == null) { imageRenderElement = factory.CreateImageRenderElement(this); if (Source != null) { imageRenderElement.Bounds = GetStretchRect(Source.Size, VisualBounds.Size, Stretch, StretchDirection); imageRenderElement.Source = this.Source; } } return(imageRenderElement); }