Welcome to WindowsClient.net | My Blog | Sign in | Join

Rob Relyea - XAMLified

WPF, Silverlight and XAML

Syndication

Sponsors





  • advertise here

November 2008 - Posts

WPF Controls

Jaime Rodriguez – Jaime did a quick port of the Chart controls from the Silverlight Toolkit to WPF.  And he gave me a quick jab at the end of the post. :-)

WPF

Mike Stedman – 52 useful posts on WPF tips/tricks in under 2 months on The WPF Waltz

Rico Mariani (VS Chief Architect) - The Visual Studio Tech Roadmap Starring VS 2010.  Discusses the remodel of VS and its use of WPF.

Charles Petzold – Simple Cable simulation written in WPF and Silverlight.

Vince Rithner – New Sobees video

Misc

Andy Clymer - Powerpoint to OneNote converter – useful tool for evolving a slide deck.

Posted by Rob_Relyea | 1 comment(s)
Filed under: ,

DotNetRocksTV (dnrTV) just posted a discussion (with video of action in VS) with Billy Hollis that goes through a number of concepts in WPF/Silverlight layout (Grid, StackPanel, size to content), ContentControl (Button, ToolTip),  and XAML (attached properties, property-elements).

Very helpful for people new to WPF/Silverlight: Billy Hollis: XAML for Developers Part One

Posted by Rob_Relyea | 1 comment(s)
Filed under: , , ,

Given another 4 years of experience since I wrote “Our 7 Goals for XAML”, here is my updated list of XAML Benefits:

XAML Describes Data in a Concise, but Human and Machine Comprehensible, Way

Declarative formats provide the best and most concise way to represent many types of data. Comprehension of a declarative format is better than a general purpose programming language.

<BookList>
  <Book Author="J. K. Rowling"
            Title="Harry Potter and the Philosopher’s Stone"
            Year="1997" />
  <Book Author="L. Frank Baum"
            Title="Wizard of Oz"
            Year="1900" />
</BookList>

BookList bl = new BookList();
Book b1 = new Book();
b1.Author = "J. K. Rowling";
b1.Title = “Harry Potter and the Philosopher’s Stone”;
b1.Year = 1997;
bl.Add(b1);
Book b2 = new Book();
b2.Author = "L. Frank Baum";
b2.Title = “Wizard of Oz”;
b2.Year = 1900;
bl.Add(b2);

XAML is Useful for Many Types of Data

Microsoft already supports XAML Vocabularies to describe UI ([MS-WPFXV], [MS-SLXV]), Workflow (WF) and Electronic Paper (XPS).  Many other vocabularies are possible. 

XAML 2009’s new Name Referencing enables object graph definition, which opens up the number of types of data that can be described. WF 4 leverages this for modeling Flow Charts. WCF 4 Services can be modeled in XAML more naturally as well.

XAML uses Typed Object Models for Better Programming and Validation

Systems that have a strongly-typed OM (object model) enable:

  • Manipulation of objects after initialization with strong-typing, which enables compile time checking of code.
  • Markup Validation using the OM as the Type’s schema, as opposed to having to build an additional schema.
class Book
{
    string Author { get; set; }
    string Title { get; set; }
    int Year { get; set; }
}
Works:
b1.Year = 2000;

Compile Time Error:
b1.Year = "6/1999";
Validation Error:
<Book Year="6/1999" />

XAML is Extensible and Version Tolerant

Systems that are extensible through class inheritance can be modeled easily in XAML.  Since BookList can hold Books, and since one can derive a PaperbackBook from Book, I can use PaperbackBook wherever a Book is allowed, in code or markup.

class PaperbackBook : Book
{
}
<BookList>
  <Book … />
  <my:PaperbackBook … />
</BookList>

XAML's default is that every tag and attribute must be known, while HTML defaults to ignoring any mistyped element name, attribute name or attribute value. While there is a place for this ignoring to allow for forward compatibility, XAML uses Markup Compatibility and Extensibility (ECMA-376 Part5) for backward/forward compatibility.

XAML is Toolable

Systems described in XAML will be creatable and consumable by a wide set of tools.  This goal drives our decisions throughout XAML, from our XML representation to schema and beyond.

XAML is XML

In .NET 3 and Silverlight, all valid XAML files must be valid XML files. The opposite isn't always true…all XML files are not XAML files. This bet on XML is important because it enables an ecosystem of tools, systems, APIs and developers familiar with XML to get a strong start on understanding XAML.

.NET 4 is broadening what it means to be a XAML document. We’re introducing a XamlReader and XamlWriter abstraction in System.Xaml.dll which enables anybody to provide or store XAML based data.  We’ll provide readers and writers for XML, BAML, and object graphs, but many other storage or in memory representations are possible.  We believe that our XML representation shipped with .NET 3.0 in 2006 will continue to be the most common representation of XAML documents, but time will tell.

XAML Enables Event Driven Programming Models

XAML enables description of object graphs which include the setting of properties and the wiring of events.  This enables systems which need an event driven programming model.

XAML is Compiled or Interpreted

XAML is sometimes treated as source code, sometimes as runtime instructions.  Different frameworks will make different choices around this: WPF chooses to compile XAML into a binary representation which gets embedded inside an assembly; Silverlight chooses to validate the XAML at compile time, but it embeds the original XAML file into a .XAP file.  Either WPF or Silverlight can also interpret at runtime a XAML file that is not downloaded with the “application”.

http://blogs.msdn.com/usisvde/archive/2008/11/02/you-re-invited-to-xamlfest-denver-november-24-25.aspx

Posted by Rob_Relyea | with no comments
Filed under: , ,

WPF Apps

Carlos Quintero: Visual Studio 2010 PDC session: customizing and extending your developing environment. Scott Guthrie announced at PDC that VS2010 would have Shell UI and code editor made with WPF.  This session goes into some details…

Brian Goldfarb: Must See: MSNBC Election 2008 Electoral Map.  For those of you paying attention to US Elections today, this WPF app may be of interest…  (p.s. go vote)

WPF Releases - CodePlex.com/wpf

WPF Toolkit released with V1 of DataGrid, DatePicker/Calendar controls, VisualStateManager preview.

WPF Ribbon Preview now available

WPF Futures now includes a Client Profile Configuration Designer

Silverlight

Shawn Burke: Silverlight Toolkit Released. Great to see a bunch of new controls for Silverlight!

WPF/Silverlight

Beatriz Stollnitz: How can I expand items in a TreeView? Beatriz is blogging again! In case you missed it, Beatriz Stollnitz (formerly Beatriz Costa) is blogging again after a 8 month pause. She is now focused on controls for Silverlight and WPF.

WPF

Tim Sneath: WPF Developers: PDC Wrap-Up and Visual Studio Tooling Update

UIHero: WPF Assembly Source Code Now Available – now available for v3.5sp1.  Debug like a developer in the WPF team.

Charles Petzold: WPF Retained Graphics and the SubPropertiesDoNotAffectRender Flag

WPF for LOB

Beth Massi: New WPF How Do I Videos Released!

Vincent Sibal: DataGrid posts: Editing. DataGridComboBoxColumn. Frozen Row Sample.

WPF Tools

WPFPerf: Update to WPF Performance Profiling Tools.  Lots of goodness.

XAML

me: PDC08 News: XAML in .NET 4: XAML2009 & System.Xaml.dll. See what I’ve been focused on for the last year or two…

XAML Vocabularies

Zulfiqar: What’s new in WF v4.0. WF 4.0 to have “First class support for authoring XAML only workflows.”

Events & PDC08

ArcaneCode – Easy links to all PDC session videos/slide.  Very handy.  I have a few links to many of the WPF oriented sessions: PDC08 – WPF Talks