The Canvas is usually an underestimated layout control in Silverlight, instead it's really useful and flexible; one the most usefull things I have discovered while playing with Silverlight is to build pages using a Canvas as the most external container and place any other layout control inside it.
Why? it has a very nice and easy support for Z-Indexing and if you diplay some controls/forms/whatever on top of each other is a very simple task to realize. You can easily build a window-like desktop application in this way.
So here's the way in which I usually define my silverlight pages/applications.
<UserControl x:Class="ContextMenuExtender.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > <Canvas x:Name="surface"> <StackPanel x:Name="LayoutRoot" Background="White"> ... </StackPanel> </Canvas> </UserControl>
Related Content
- Silverlight: simulate a 'Windows' desktop application - part 1 (26/08/2015)
- Silverlight: Custom Buttons with Templates (09/01/2008)
- Silverlight: How to Add a Context MenĂ¹ to a FrameworkElement (26/08/2015)
- Silverlight: Dropdown Menu Control (10/07/2008)
- Silverlight: how to build a simple Menu Control (26/08/2015)
- More related document (43)