Intellisense in XAML for your types too!
Recently there were renewed requests from a control vendor and some developers in the forums for intellisense support for non-"xaml/presentation" types.
Looky here:
(This shows an XML editor view showing elements from a clr-namespace mixed in with element from xaml/presentation.)
I’ve spent some time the past few days trying to complete building a solution to enable this.
History of the XSD Generator
The ASP.NET team had to do similar things…generate an XSD using reflection against .Net assemblies. Several years ago, probably 2002 or early 2003, I got a drop of their code. I had a pm intern build a tool that would reflect on PresentationFramework, PresentationCore and WindowsBase and generate an XSD for "Avalon’s" types.
Over the years, I ended up enhancing this tool to improve the intellisense experience for XAML inside of XSD aware tools. This included a major push during August of 2005 to make the XSD relect most of what was possible. (I no longer enforced that only a Page or Window could be at the root, for example, any object would be fine.) During that push, I ended up adding the concept of SubstitutionGroups to the XamlPresentation2006.xsd.
Substitution Groups
Substitution Groups enable you to model subclassing like model in schema. It gave me hope that I could support non-"xaml/presentation" types in XSD appropriately – something I had long though impossile with XSD.
Now I have been working on adapting the xsd generator to work on different .dlls.
For example, in my WpfUtilities dll that I am working on, I define a ProxyElement (which I’ll write about in the future). If a new XSD is created that defines this element:
<xs:element name="ProxyElement" type="dProxyElement" substitutionGroup="wpf:sgDecorator"/>
And if we put that XSD in c:\program files\microsoft visual studio 8\xml\schemas with the right clr-namespace uri, intellisense works.
What is left
Unfortunately, I had to hand modify the output of the schema generation tool to make it work. I still need to:
- adapt the XSD Generator to do all those things the right way
- consider how to fix a problem I noticed in XamlPresentation2006.xsd (i didn’t create substitution groups for elements which don’t have subclasses.)
- figure out where/how to ship this tool (and potential changes necessary for XamlPresentation2006.xsd) – i want to get it out soon…
Stop-Gap
As I’ve probably written about a few times, the Visual Studio team is planning on building a native XAML Editor…one that doesn’t use XSD, but instead just directly examines types in assemblies, etc…
So, hopefully we can count the number of months that this will be useful on 1 (or maybe 2 hands)…
I\’m still working on this… It is opening up a can of worms… Now I have to get them back in the can. Taking longer than I hoped
any news about when there will be an update for the XAML editor in VS? will it be available for 2005 or only in the new VS?
regards,
TimC
Just to make sure people new to WPF or my site know: (my blog gets lots of hits from Live.com, google, etc…)
The best Xaml Intellisense is available in VS "Orcas". As of now, Beta1 is shipping and it supports Xaml Intellisense across 3rd party types!
lotro gold lord of the rings gold lord of the rings online gold lotro gold lord of the rings gold lord of the rings
online gold Warhammer gold
Warhammer online gold Warhammer money War gold War money Tabula Rasa Credit lotro gold lord of the rings gold lord of the rings online gold lord of the
rings online gold lord of the rings
gold Tabula Rasa Credit World of Warcraft gold PotBS Doubloon Pirates of the
Burning Sea Doubloon PotBS Gold Pirates of the Burning Sea
Gold lotro gold lord of the rings gold lord of the rings online gold Tabula Rasa Credit Warhammer gold Warhammer online gold PotBS Doubloon PotBS gold Pirates of the Burning Sea
gold Pirates of the
Burning Sea Doubloon
Amberdigital Branch,Southern Stars Enterprises Co is specializing in the development and manufacturing of screen advertisings, digital sign, digital signages and LCDs. Established in 1996, we have explored and developed the international market with professionalism. We have built a widespread marketing network, and set up a capable management team dedicated to provide beyond-expectation services to our customers.
amberdigital Contact Us
Southern Stars Enterprises Co (Hong Kong Office)
Add:3 Fl, No.2, Lane 2, Kam Tsin Tsuen, Sheung Shui, Hong Kong
Tel:+852 2681 4099
Fax:+852 2681 4586
Southern Stars Enterprises Co (Shenzhen Office)
Add:DE, 16/F, Building 2, Nanguo Tower, Sungang Road, Shenzhen, China
Tel:+86 755 2592 9100
Fax:+86 755 2592 7171
E-mail:sstar@netvigator.com
website:www.amberdigital.com.hk
alibaba:amberdigital.en.alibaba.com[aifcbheeicecca]