I want to get started with SoapBox Core. I know that even building a simple application on top of SoapBox Core will itself be an add-in. How do I create my first add-in?

asked 31 May '10, 23:35

Scott%20Whitlock's gravatar image

Scott Whitlock ♦♦
accept rate: 50%

edited 31 May '10, 23:37

Folder Structure

I suggest setting up the following folder structure. It's not mandatory, but the instructions on this page are based on this structure. Note that I'm assuming this structure is inside of a specific branch in your source control (e.g. /trunk or /releases/v1.0, etc.).

    (AvalonDock projects go in here)
    (NLog project goes in here)
    (Physics2D projects go in here)
    (DLLs like the MEF library go in here)
        (SoapBox.Utilities project goes here)
        (all SoapBox.Core projects go in here, each in their own folder)
        (your projects go in here, each in their own folder)
    (or in here)
    (Both SoapBox.Core and your projects will all compile into here, 
     so they can find each other)

Visual Studio Solution

  1. Create a Visual Studio Solution for whatever it is you're building in the root directory.
  2. You will need to include all of the SoapBox.Core projects in this solution. I suggest putting them in a SoapBoxSoapBox.Core solution folder.
  3. SoapBox Core will have project references for AvalonDock, NLog, and Physics2D, so you will need to include these in your solution as well.
  4. I suggest creating solution folders for your own projects. First create a top level one for YourNamespace, then sub folders for each of YourSubNamespaces.
  5. Create a new WPF User Control project, give it a name like YourNameSpace.YourSubNamespace.AddInName. In the location box, specify the YourNameSpaceYourSubNamespace directory. This will create a new folder under that directory and place your new project in there.
  6. Your new project will have an automatically created user control called UserControl1. You can delete this.
  7. Add a reference to the ReferencesSystem.ComponentModel.Composition.dll
  8. Edit your project properties for this new project and go to the Build tab. Change Output path to ......bin so that the DLL will be deposited in the bin directory with the Host executable.
  9. Add a project reference for this new project to SoapBox.Core.Contracts. This gives you access to interfaces and helper classes you will need to add menu items, tool bars and tool bar items, status bars, options pads, documents and tool pads to the workbench, along with grabbing references to the logging component.
  10. Add a project reference for this new project to SoapBox.Utilities. This gives you access to the NotifyPropertyChangedHelper, which is a fundamental tool for creating ViewModel classes.
  11. If you want to build something based on the Arena module (the 2D simulator), you will also need a project reference to SoapBox.Core.Arena, but this is optional.
  12. When you build the project, you should see your new Add-In DLL in the bin directory. When SoapBox.Core.Host.exe runs, it will scan that DLL for exports that extend the SoapBox.Core library modules. Of course, you haven't written any yet, so it won't do anything...

answered 31 May '10, 23:37

Scott%20Whitlock's gravatar image

Scott Whitlock ♦♦
accept rate: 50%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 31 May '10, 23:35

Seen: 2,542 times

Last updated: 31 May '10, 23:37

powered by OSQA