Click here to Skip to main content
13,090,446 members (42,563 online)
Click here to Skip to main content
Add your own
alternative version


22 bookmarked
Posted 29 Jul 2005


, 29 Jul 2005
Rate this:
Please Sign up or sign in to vote.
A library for creating plug-ins with User Interface created from an XML file.



In this article, I can illustrate what is Fireball.XmlGui and give a brief introduction to it. The library is under development and any suggestions and bug feedback are very much appreciated. If you find a bug please register here and send us the issues. Fireball.XmlGui is licensed under LGPL and this is very useful for programmers who need to use the library for commercial applications because LGPL doesn't force you to distribute your source code, you only need to distribute or link to my site for Fireball.XmlGui source code. For news about this library, go to my home page and get the latest binary from there.


Fireball.XmlGui was developed for adding to plug-in based applications the support for creating dynamic plug-ins with a simple XML file. The syntax is very like XAML and it is also possible to use the code-behind! You only need to specify on the root of the document the attribute CodeBehind with the filename of the C# source file. The library is not limited to System.Windows.Forms GUI creation. You can also use it for dynamically creating any other type of classes, for adding classes as subnodes on the XML, like the Controls tag on this example. You need only the collection and inherit from the System.Collections.IList.

Using the code

See the next XML sample code:

<?xml version="1.0" encoding="utf-8" ?>

<XFGDocument Name="Sample XmlGui" 


      <Assembly Name="System.dll" />
      <Assembly Name="System.Drawing.dll" />
      <Assembly Name="System.Windows.Forms.dll" />
  <MyForm Name="Prova"  Height="300" Width="400" Text="Hello World!">
      <ToolStrip Name="ToolStrip1">
      <MenuStrip Name="MenuStrip1">
                <ToolStripMenuItem Text="File" >
                        <ToolStripMenuItem Text="New" Click="MyForm.OpenClick"/>
                        <ToolStripMenuItem Text="Open" Click="MyForm.OpenClick"/>
      <Panel Dock="Fill" BackColor="Color.Red">
              <WebBrowser Name="browser1" Dock="Fill" />
      <StatusStrip />

The root element is XFGDocument. On this tag you need to set its name and the NameSpaces attribute to all namespaces you need to use from XML each separated by a , (comma). You can also specify the code-behind file with the attribute CodeBehind. In this example, the first child tag of the document needs to be a form. In this example, I use the class declared on the code-behind file. MyForm is a class that inherits from System.Windows.Forms.Form. Next, the source code of the code-behind file:

using System;
using System.Drawing;
using System.Windows.Forms;
namespace customNamespace
    public class MyForm : Form
        static MyForm MyFormIstance;
        public MyForm()
            MyFormIstance = this;
        public static void OpenClick(object sender,EventArgs e)
            WebBrowser br = 
              (WebBrowser)MyFormIstance.Controls.Find("browser1", true)[0];

The source code is very short and simple, and you don't need to be a guru for creating a GUI with this library ;). On the XML code, if you need to set a property, you can do it as an attribute. For the moment, that is all. If you have any questions about the library, don't hesitate to contact me. I plan to write more about this library in future. At the moment, my time is dedicated to the development of the library, and other works ;)

Note: for running the sample, go on the sample bin/debug directory and execute the run.bat file.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
Italy Italy
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMyXaml Pin
Marc Clifton29-Jul-05 5:36
protectorMarc Clifton29-Jul-05 5:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170813.1 | Last Updated 29 Jul 2005
Article Copyright 2005 by dotnetfireball
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid