Adding Controls and Handling Events
Adding controls and UI elements to a Silverlight user control is an easy task and looks like what was already described about WPF. While you go through adding controls, you can also notice how Silverlight properties are in most cases the same as WPF properties. Replace the Background
property value in the main Grid
from White
to SteelBlue
. This provides better visibility of the user control in the web browser. Notice that you can still apply brushes as in WPF. Next, add a TextBlock
control and place it at the top of the user control. Set its properties so that the foreground color is white and the font size is 24. Finally drag a Button
control from the toolbox onto the user control surface. Also notice how ...
Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.