Every time you could have imagined for any background
image for your application and for some controls. In Silverlight 2 and
Silverlight 3 Beta it was not so easy to put Images as Background and do some
Tiling. Using Tile Brush in Silverlight 3 we will be able to use images as
background. In this article we will see how can we achieve that.
Crating Silverlight Project
Fire up Blend 3 and create a
Silverlight Application. Name it as TileBrushInSL3.
- First thing we will do Image Brush is for the Grid (LayoutRoot).
- Select the Grid, go to the Properties Panel Choose the Brush Category and
choose Tile Brush.
- Choose any Image (PNG or JPEG), and it's done.
can Stretch in of four types here:
- Uniform To Fill
Try out the above Stretch modes and you
will get your best one match for your control.
Now we will add some
controls and see how Tile Brush is effected here.
- Add a TextBlock and do the same we did earlier steps and you will find
something similar to the following.
Without Tile Brush
With Tile Brush
that cool! I have just changed the Font Size of the TextBlock to look
Suppose you have a List Box in your application do change the
Background Brush to Tile Brush and it will look like below.
you can change your other Controls and their Brush to Tile Brush and play with