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

Rob Relyea - XAMLified

WPF, Silverlight and XAML

Syndication

Sponsors





  • advertise here
Template at root of XAML file problems...

Internal mail thread...read bottom to top...

 

From: MS Guy

I’m completely dumbfounded, but that works.  Thanks…

From: Rob Relyea

Templates are special beasts in 3.0/3.5.  We hope to enable this in the future…

I would try a ResourceDictionary with x:Class….

From: MS Guy
Subject: The attribute 'Class' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml'?

Try compiling a simple .xaml file consisting of:

<ControlTemplate xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

x:Class="MyTemplate">

<Button Click="Button_Click"/>

</ControlTemplate>

What’s up with this error?  Everyone uses x:Class where xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" on a daily basis.

Is there some other way of defining reusable templates with code behind?

Published Thursday, April 17, 2008 12:27 PM by Rob_Relyea
Filed under: ,

Comments

# re: Template at root of XAML file problems...@ Friday, April 18, 2008 12:12 PM

At www.xamltemplates.net you can find a free template to download and has all the controls stylized.

# re: Template at root of XAML file problems...@ Friday, April 18, 2008 6:52 PM

Sorry Rob, you lost me in there.

Are you saying that he should use a ResourceDictionary instead of the ControlTemplate?

Doesn't this mean that his class needs to derive from resource dictionary too?

Can you post a follow-up of how to provide real code-behind ControlTemplates in SL B1?

And please, please, please get these basic tenets added to SL2 before it's released.  Missing controls and missing features are fine for download size.  But the fundamentals have got to be the same.

by Joe

Leave a Comment

(required) 
(required) 
(optional)
(required)