Department of InformatiX
Microsoft .NET Micro Framework Tools & Resources

Micro XAML Tool

by Jan Kučera, last updated: 21/3/2014.

This project costs my personal free time. If it helps to save your time, please support its development.
13,325 downloads, 4 donations – thank you!

Update 3/21/2014: 1.0.2.3

Update 9/29/2010: 1.0.2.2

Update 4/19/2010: 1.0.2.1

Update 3/12/2010: 1.0.2.0

Update 24.2.2010: 1.0.1.1

Update 10/11/2009: 1.0.1.0

Update 12/7/2008:

 

Sure, writing an user interface in code is not a problem. Actually, every good WPF developer should know and understand the code which XAML describes. However, it ofen means lots of code lines, and every help counts. How would you like to write the UI using XAML, including intellisense support?

Sample XAML from the Micro WPF Template

Okay, enough speaking, you can download the package here (53 kB, ZIP). Installation steps:

  1. This is a prerelase version and likely has bugs - you have been warned...
  2. The main file is the MicroXamlTool.exe. Put it into any directory you would like to keep it in.
  3. It is a custom tool, and as such it must be registered with the Visual Studio. The application can register itself automatically, if you run it as administrator without parameters:
    MicroXamlTool registration
    (note: you can unregister it by running it again)
  4. All five schemas (the files with a .xsd extension) need to be placed in the appropriate Visual Studio folder, typically C:\Program Files\Microsoft Visual Studio 11.0\Xml\Schemas. These files provide the intellisense support.
  5. Move the packed Micro WPF Window.zip archive as it is into the item templates folder, typically C:\Users\You\Documents\Visual Studio 2012\Templates\ItemTemplates. This file is the standard template for new microxaml files (see the code on first screenshot) - you will see it in the project's add new item dialog:
    Adding a new item to the project
  6. Starting with Visual Studio 2012, you might need to run devenv.exe /setup as an admin if no code is being generated.

And that's it! How to try it:

  1. Run the Visual Studio and create a new Micro Framework project of Window Application type.
  2. Add a new item to the project - in the My Templates group, choose Micro WPF Window.
  3. Open the Program.cs and change the line number 16 to:
    Window mainWindow = new Window1();
  4. Run the project. You should see a yellow window with Hello World! text in it.
  5. If you change the type of mainWindow to Window1, you can directly access the named controls: mainWindow.MyLabel1 and mainWindow.MyLabel2.

Known limitations, planned to be resolved:

Some cool stuff:

Known limitiations which you'd rather get used to:

Have a fun and let me know about any questions or issues!

Comments
Comment Roland 2/14/2011 8:40:38 AM
> Only objects from project's referenced assemblies are supported. > You cannot instantiate nor access objects directly declared in your project. Does this mean that you can actually define your own UIElements in an external assembly, declare it as additional namespace and instantiate these? I would really love this feature, but seems not to work. :( Cheers, Roland
Comment Steve Maillet 2/28/2011 9:33:10 PM
On Windows Vista and Windows 7 with UAC you will likely see an error registering the single file generator (0x80131515). To resolve this you will need to: 1) right click on the EXE 2), select properties and click on the Unblock button to unblock the application since it is considered untrusted download by default.
Comment Sergio Carrero 3/25/2011 6:40:21 AM
Could you post a sample project where you use the template? I've tried everything but my project does not recognize the Window1 item. System Specs: WIndows 7 x64, VS2010, Net MF 4.1.
Comment J.B. Klein 4/27/2011 9:36:21 AM
I am running Win7 with Visual Studio 2010 SP1. I have the same problem as Sergio, and when i right-click Window1 and click run custom tool i get "Cannot find custom tool 'MicroXamlTool' on this system" . I registered the tool. Is there a way to manually setup this tool?
Comment Craig Darling 2/1/2012 9:07:59 PM
how can we download the newest version of this tool?
Sign in using Live ID to be able to post comments.