Now, we are going to create a new UserControl
to display a score gauge. In this case, we will use 2D gauges. Later, we will have to use this UserControl
in the 3D scene.
1. Open the project
3DInvadersSilverlight
in Expression Blend.2. Click on
3DInvadersSilverlight
in the Projects palette.3. Select File | New Item... from the main menu. A dialog box will appear.
4. Select UserControl in the list, enter the name ScoreGauge for this new
UserControl
and click on OK. A new item will be added to the3DInvadersSilverlight
project, namedScoreGauge.xaml
.5. Change the
LayoutRoot Grid
size properties:Width: 300
Height: 49
6. Draw a rectangle aligned to the
LayoutRoot Grid's
borders.7. Click on Brushes | Fill | Gradient brush | Linear gradient and define both the desired start and stop colors. Then, apply a drop shadow effect. The rectangle will display a nice background linear gradient, as shown in the following screenshot: