For anyone that is interested, here is what i've found so far with Jason 
Stangroome's help.


1.       Reference Microsoft.Expression.Framework

2.       Make your class implement Microsoft.Expression.Framework.IPackage

3.       Done, blend will pass in the application context into your class so 
that you can interact with blend
You then just need to start blend like so "blend.exe -addin:BurelaAddin.dll"


You can get blend to start the addin automatically with a bit of extra work.

1.       Create a manifest text file (BurelaAddin.addin)

2.       Put in a single line in the manifest file that points to your .dll 
<AddIn AssemblyFile="BurelaAddin.dll" />

3.       Putt the manifest file and your dll in a subfolder of your blend 
directory called "Addins"

4.       Blend will now automatically start your addin

One heads up, there is a difference in how your addin starts up based on how 
you start blend

·         Starting blend with "Blend.exe -addin:BurelaAddin.dll": Blend will 
fully start up and THEN load your addin

·         Starting blend by putting addin in /Addins: Blend will start your 
addin BEFORE blend has fully initialised. This means you can't do things like 
add menu items, as they don't exist yet.

Here is a quick example of how to do this yourself.
public class Class1 : IPackage
{
    private IApplicationService _applicationService;

    public void Load(IApplicationService applicationService)
    {
        _applicationService = applicationService;
        applicationService.WindowService.Initialized += 
WindowService_Initialized;
        
//applicationService.CommandBarService.CommandBars[0].Items.AddMenu("Burelamenu",
 "Burelamenu");    //will crash if we don't use -addin:
    }

    void WindowService_Initialized(object sender, EventArgs e)
    {
        
_applicationService.CommandBarService.CommandBars[0].Items.AddMenu("BurelaMenu",
 "BurelaMenu");    //Won't crash now, because the app has inited

        var fileMenu = 
_applicationService.CommandBarService.CommandBars[0].Items[0] as 
ICommandBarMenu;
        if (fileMenu != null)
            fileMenu.Items.AddMenu("BurelamenuItem", "BurelamenuItem");
    }

    public void Unload()
    {

    }
}

-David Burela

From: ozsilverlight-boun...@ozsilverlight.com 
[mailto:ozsilverlight-boun...@ozsilverlight.com] On Behalf Of Jonas Follesø
Sent: Tuesday, 2 February 2010 2:19 AM
To: ozSilverlight
Subject: Re: Addins in expression blend 3

Hi David,

I simply haven't found time to get my Colorful add-in up and running on 
Expression 3.0.

You are right that the add-in modell changed. It was actually never intended as 
a "real" add-in modell, but something used by the expression team to do things 
like automated testing.

Anyways, your best bet is to fire up Reflector and start digging around. I did 
that some time back, and could find a bomunch of hooks that looks interesting, 
so I am sure it is still possible to write add-ins.

Let us know if you find some useful information, as I still need to get mine 
updated to 3.0 :)

Good luck!

-jonas
On Mon, Feb 1, 2010 at 5:20 AM, David Burela 
<david.bur...@readify.net<mailto:david.bur...@readify.net>> wrote:
There doesn't seem to be too much information out there on creating add-ins for 
expression blend.
The main add-ins that existed (unify, colourful expression, xaml editor) are 
all still compiled for expression blend 2 but the add-in model changed in blend 
3, so looking at the source code on codeplex isn't a help.

Anyone got some links to get started?
-David Burela

_______________________________________________
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com<mailto:ozsilverlight@ozsilverlight.com>
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight

_______________________________________________
ozsilverlight mailing list
ozsilverlight@ozsilverlight.com
http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight

Reply via email to