I have a window with a background image. The image may change at runtime which really should not matter for this.
I want the image to be fixed to the top left (which it is) and not scale (which is also correct. But I need the image to repeat (tile) when the window is made larger than the image. I am doing …
What am i missing?
TIA
You need to set the
TileModeproperty as well as theViewportandViewportUnits:For example:
Note: the second 2 segments of the
Viewportattribute indicate the desired size of each repetition. If you want to display the entire image, these should be the width and height of the image.Example output:

Edit in response to comments
If you don’t know the size of the image to specify in the
Viewportproperty, you can use aBindingwith anIValueConverterto calculate it from the image. I am convinced there must be a better way of doing this, but I haven’t found one yet!XAML:
Value converter: