I've created my first WPF form, and the ImageBrush XAML is giving me trouble.

The XAML I have is:

<Grid.BackGround>
    <ImageBrush ImageSource="ImageFile.png" TileMode="Tile" />
</Grid.Background>

It displays the correct image - but it's stretched instead of tiled! The image is 127x127; the window is 660x808; a single instance of the image is stretched to fill the window instead of multiple tiles of the image filling the window.

What am I doing wrong?!

Aha! Found it: Viewport & ViewportUnits seems to have done it. Had to look into Rectangle to find an example of it, but it works.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.