William Thompson

William Thompson

  • 1.6k
  • 155
  • 299.7k

How do you generate classes from XAML in Visual Studio 2008?

Jun 28 2010 1:56 PM

How do you generate classes from XAML in Visual Studio 2008?
I have a Silverlight project.  The XAML has been written in Expression Blend.  I am told that I can use Visual Studio to use the grid classes in the Page.xaml file (the whole solution is loaded into Visual Studio) to generate the .CS (C#) files in Visual Studio 2008 that correspond to the several <grid> classes in the XAML.  How is this done?  Is there a wizard somewhere that will do this for me?  Do I have to do this by hand?
When I open the Page.Xaml file and click on the name of the <grid> node, (x:Name) and select, to view code, it takes me to a file without much meat on it:
    public partial class Page : UserControl
    {
        public Page()
        {
            InitializeComponent();
        }
    }
Since each <grid> contains a lot of components, I was expecting more.
Am I supposed to expand on this class by hand and code all the methods for this "Page" class?  Is there a tutorial that shows how to do this?