I'm reading Silverlight 2 Unleashed, published in October 2008 and it has examples in it with a root canvas tag:
<Canvas xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Background="Red"
Width="500"
Height="300">
<Ellipse Width="400"...
However when I create a new Silverlight Application in VS2008, I get a UserControl root tag:
<UserControl x:Class="TestFirst.Page"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300">
<Grid x:Name="LayoutRoot" Background="White"...
Of course I can change this by replacing the root tag with Canvas but then I have to also change the code behind to inherit from Canvas instead of UserControl and have to take out the InitializeComponent method.
- Is using the Canvas tag as the root standard or is the book going about an alternate way to create Silverlight applications?
- What are the advantages of using Canvas instead of UserControl as the root element?
- Why would the book for its first examples create silverlight applications in a different way than is given by default in Visual Studio?
- Is there a way to have a canvas tag generated as the root tag by default in Visual Studio?