O'Reilly logo

Beginning Windows® Phone 7 Application Development: Building Windows® Phone Applications Using Silverlight® and XNA® by Robert Fonseca-Ensor, Karli Watson, Nick Lecrenski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 3 EXERCISE SOLUTIONS

Exercise 1 Solution

False. By default, you can use HTML color codes only when declaring brushes in XAML. If you need to use HTML color codes in the code-behind file, you have to create a custom conversion method that parses the color code into red, green, and blue components and then pass those into the Color.FromARGB method.

Exercise 2 Solution

Choices a and b are not valid shape objects in Silverlight. Silverlight provides the Rectangle, Polyline, Polygon, Path, Ellipse, and Line objects for drawing various shapes on the screen.

Exercise 3 Solution

When you use the TransformGroup object, the order in which transform effects are added matters. The transforms will be applied to the target object in the order in which the effects are added to the group.

Exercise 4 Solution

When you need a way to repeat a task on a timed basis, you should always use the DispatcherTimer object. This ensures that the repeated task will not interfere at all with the main user interface, and it also gives you the ability to run custom code during every Tick event.

Exercise 5 Solution

Choices c, e, and f are not valid transform effects. Silverlight provides the RotateTransform, SkewTransform, ScaleTransform, and TranslateTransform effects.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required