SVGImage icon indicating copy to clipboard operation
SVGImage copied to clipboard

[BUG] SVGImage inside Button does not show up

Open anslmorvan opened this issue 10 months ago • 4 comments

Describe the bug When placing an SVGImage inside a Button, the SVG does not show up, unless we put explicitly Width and Height on the SVGImage.

To Reproduce Steps to reproduce the behavior:

  1. In a XAML, put an SVGImage without Width and Height information and assess it works and follows what is expected regarding its SizeType.
  2. Put the SVGImage inside a Button, and see that the image does not show up inside the button.
  3. Put Width and Height on the SVGImage, and see that the image is shown inside the button.

Expected behavior The SVGImage should take the size as allowed by the Button, without the need to define its Width and Height.

Screenshots Step 1:

Image

Image

Step 2:

Image

Image

Step 3:

Image

Image

anslmorvan avatar Mar 26 '25 10:03 anslmorvan

Note that settings the property SizeType to SizeToContent makes it work, yet it does not with any other value:

Image

Image

(I am personally interested in using ViewBoxToSizeNoStretch and it does not work with this value.)

anslmorvan avatar Mar 26 '25 10:03 anslmorvan

I'm currently not actively using or working on this library, so you need to look for the issue yourself or hope someone fixes it. I've you look after it and create a pull req, I'll look to merge.

jogibear9988 avatar Mar 26 '25 11:03 jogibear9988

No problem, I'm going to have a look at it.

anslmorvan avatar Mar 26 '25 12:03 anslmorvan

try to set width and height to SVGImage

Image

Microsoft6477 avatar Aug 25 '25 03:08 Microsoft6477