Moving your work from MDriven Designer to MDriven Framework

This article was moved to MDriven Wiki Moving your work from MDriven Designer to MDriven Framework

When you have modeled in MDriven Designer and want to turn your model into a full application – read on.

To have the explicit c# code for each model class you need MDriven Framework that is a plugin for Visual Studio.

Start Visual Studio and make sure you have MDriven Framework installed by creating a new project and finding the ECO7 templates:


Create a new project based on the EcoProject1 template.

Add another new project based on the standard WPF Application template:


Open the EcoMdl file named in the EcoProject1 project.

In the Modlr Toolbox window – right click on the Packages note and find import:



Find YOUR model from your MDriven designer work and import it.

Delete any package that came from the template and you do not need.

1. Press “Update Code” in Modlr surface.

2. Build all.

3. Add the package to the ecospace:


4. Add the EcoSpaceAndModel project and Needed Eco assemblies to your WPF project:



5. To get your VisualStudio WPF application to initially work just as the prototyper in MDriven Designer we use the WECPOFTabBased model driven approach:


Here is the code from the picture so that you can copy and paste:

<Window x:Class="WpfApplication2.MainWindow"
        Title="MainWindow" Height="350" Width="525" >
      <wecpof:WECPOFTabBased x:Name="wECPOFTabBased">

6. In codebehind we do this:

  public partial class MainWindow : Window
    EcoProject1EcoSpace _es;
    public MainWindow()

      _es=new EcoProject1EcoSpace(); // Instansiate your EcoSpace
      _es.Active = true;
      // Turn on AsyncLoading so that UI never locks up while loading/saving
      // Let WECPOF know about our EcoSpace

      this.Closing += MainWindow_Closing;

    void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
      // Disable quit if there are unsaved changes 
      e.Cancel = _es.DirtyList.AllDirtyObjects().Count > 0;

    void MainWindow_Closed(object sender, EventArgs e)
      // Turn of the EcoSpace on quit to gracefully end app
      _es.Active = false;

7. Hit F5 to compile and execute:



This is of course just the start of your journey to deliver your app. Now you can start to work with WPF styles to get the look the way you want. You can work with content overrides to inject your own UI controls like we do with WhenAndWhereProject:


Or you can go fully MVVM standard by using CodeGen on your viewModels. There are no limitations on how you use your model from this point onwards.

MDriven Framework use the ecomdl format to save your model. This format is multi file and uncompressed to better facilitate diff tools and source code repositories like GIT and SVN. This is important when having multiple developers changing the model at the same time.

You can open the ecomdl file structures with MDriven Designer – so you can continue to use MDriven Designer along with the MDriven Framework.

This entry was posted in MDrivenDesigner, WECPOF, WPF and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.