Free Study Guide for the Windows Presentation Framework exam 70-511: Canvas, one of the derived Panel Classes

 

The canvas derived Panel class, this class defines an area in which you can position child elements by coordinates that are relative to the Canvas area. (From 10625A Developing Applications with Visual Studio 2010 page 3-7).

Because the position of child elements is absolutely from the upper left hand corner, Canvas may not support localization of a number of languages.  Canvas seems like a good choice in most situations and is widely used in examples, so not everyone is worried about the localization apparently.  On the exam, it appears to be an issue, as with many things, memorize that when choosing one of the derived Panel Classes, Canvas is not a good choice because of the localization issues.

Canvas is one of the derived panel base classes available on Windows Phone 7.

 

Code (from 10626A Developing Windows Applications with Microsoft Visual Studio 2010):

 <Page xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation" 
      xmlns:sys="clr-namespace:System;assembly=mscorlib" 
      xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml" Height="226" Width="827">
  <Canvas Height="225" Width="825">
    <TextBlock FontSize="20" Canvas.Top="5" Canvas.Left="20">Panel Base Class: Canvas</TextBlock>
    <TextBlock FontSize="22" Canvas.Top="38" Canvas.Left="20">Canvas 
        defines an </TextBlock>
        <TextBlock FontSize="22" Canvas.Top="73" Canvas.Left="20"> area where you </TextBlock>
        <TextBlock FontSize="22" Canvas.Top="100" Canvas.Left="20">
            position child elements by coordinates relative to the Canvas class
        </TextBlock>
    </Canvas>
</Page>

 

Reference: Developing Windows Applications with Microsoft Visual Studio 2010 and internet sites as indicated.

NNNN