Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }