none
Invalid Markup in xaml design view - except app runs - how to fix Invalid Markup message (VS2012)?

    Question

  • I have a test wpf app I created in VS2012.  It is based on a sample from VS2008.  It is a datagrid wpf sample that displays data from the Customer table in Northwind db.  I am using the wpf2008toolkit dll for the datagrid.  The app opens up the datagrid display window from a xaml Menu window (the main window).  This is running OK, but in the design view of the datagrid display window  (called "DatasetCRUDExample.xaml")  I have this "Invalid Markup" message in place where the datarid should be.  Note:  I added a subfolder to the project called "DatasetExamples" which is the way the 2008 sample project had it.  The "CustomerDataProvider" class resides in a class file called "NorthwindDataProvider.cs"  (not using MVVM) that resides in the "DatasetExamples"  subfolder.   The actual error message is this:

    Error 1 Nested types are not supported

     I would appreciate a suggestion for a workaround for this error.  Actually, in VS2012 -- do I even need to use wpf2008tookkit dll for the datagrid?  How could I do this without using wpf2008toolkit?  Below is a pictures of my VS2012 design view problem and below that is the code behind for the "NorthwindDataProvider.cs"

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Data; using myWPFdatagridTestApp.NorthwindDatasetTableAdapters; namespace myWPFdatagridTestApp.DatasetExamples { public class NorthWindDataProvider { private static NorthwindDataset northwindDataSet; public static NorthwindDataset NorthwindDataSet { get { if (northwindDataSet == null) { northwindDataSet = new NorthwindDataset(); } return NorthWindDataProvider.northwindDataSet; } }

    } public class CustomerDataProvider { private CustomersTableAdapter adapter; public CustomerDataProvider() { NorthwindDataset dataset = NorthWindDataProvider.NorthwindDataSet; NorthWindDataProvider.NorthwindDataSet.Clear(); NorthWindDataProvider.NorthwindDataSet.Customers.Clear(); adapter = new CustomersTableAdapter(); adapter.Fill(NorthWindDataProvider.NorthwindDataSet.Customers); } void CustomersRowModified(object sender, NorthwindDataset.CustomersRowChangeEvent e) { adapter.Update(NorthWindDataProvider.NorthwindDataSet.Customers); } public DataView GetCustomers() { return NorthWindDataProvider.NorthwindDataSet.Customers.DefaultView; } } }

    Thanks


    Rich P


    • Edited by Rich P123 Monday, December 23, 2013 9:41 PM ....
    Monday, December 23, 2013 9:34 PM

Answers

All replies