The Artima Developer Community
Sponsored Link

.NET Buzz Forum
CLI300: Building Avalon Apps with Controls and Dialogs

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Tim Sneath

Posts: 395
Nickname: timsneath
Registered: Aug, 2003

Tim Sneath is a .NET developer for Microsoft in the UK.
CLI300: Building Avalon Apps with Controls and Dialogs Posted: Oct 27, 2003 6:27 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Tim Sneath.
Original Post: CLI300: Building Avalon Apps with Controls and Dialogs
Feed Title: Tim Sneath's Blog
Feed URL: /msdnerror.htm?aspxerrorpath=/tims/Rss.aspx
Feed Description: Random mumblings on Microsoft, .NET, and other topics.
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Tim Sneath
Latest Posts From Tim Sneath's Blog

Advertisement

When you install the Longhorn Developer Preview SDK, it adds a number of new project templates to the VB and C# IDE:

  • application
  • custom control
  • document project
  • hosted application
  • navigation application
  • screen saver
  • sidebar tile.

Within a project, you can easily add different XAML files based on a series of pre-defined templates.

Here's a very basic example of a XAML window definition:

   
   <FlowPanel xmlns="http://schemas.microsoft.com/2003/xaml">
   Here's a listbox: <ListBox ID="listBox1">
   <ListItem>Item1</ListItem>
   </ListBox>
   </FlowPanel>

You can create styles for items (to set a consistent look or feel across multiple instances of a control). These are created within a .resources element that matches the panel (e.g. <FlowPanel.Resources>). These are called compound property tags.

What happens when you build a XAML-enabled application? The XAML gets turned into two separate things: a .g.cs file (which is a partial class containing any code that you've included in the XAML file), and a .baml file (which contains a binary pre-processed representation of the rest of the XAML). The .g.cs file gets compiled in combination with any code-behind class you have to produce the final .exe.

There are five element families: controls, panels, decorators, shapes and content elements. Each of these primitives can be subclassed to modify the standard behaviour.

Panels come in a number of different styles: DockPanel, GridPanel, FlowPanel, TablePanel and Canvas are all included with the Longhorn SDK. The DockPanel allows you to create multiple controls that are each docked, much like the docking property of controls in WinForms today. GridPanel provides a simple grid view that allows controls to be aligned in multiple columns. FlowPanel simply flows controls (either horizontally or vertically), much like IE shows HTML. Panels can be nested within other panels, so you can mix and match different layout types within a form. Or you might have a DockPanel within a DockPanel in order to dock items within a master panel control.

The concept of a document is far stronger in Avalon than in the traditional WinForms environment. Like MFC, there is a view infrastructure. One clever feature is that the SDK installs an Avalon printer driver into Longhorn that can be used to generate these documents. So, for example, if you printed a Powerpoint slide deck with the printer driver, it would generate a XAML document that could be rendered as part of a form.

Read: CLI300: Building Avalon Apps with Controls and Dialogs

Topic: PDC – PreCon Session - .NET The Smart Client Perspective (Part 4) Previous Topic   Next Topic Topic: Dolphins/Chargers Game Moved to Sun Devil Stadium

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use