This project has moved. For the latest updates, please go here.

How To Load Xaml As GUI

Topics: Editor UI
Apr 25, 2013 at 10:45 PM
Hi Jacobi, its been a while...

Could you give me some pointers on how to show a xaml file as the plugin GUI
in VB.NET

I understand you create a PluginEditor file which Inherits the IVstPluginEditor interface
and on the VB.Net side you load the xaml file dynamically but I can't figure out how to deliver
the UI. Would it be in the open method?

I would greatly appreciate a small example in VB.Net if possible.

Thanks
Coordinator
Apr 26, 2013 at 6:43 AM
Hi,

Take a look at the CorePlugin Sample project. It demonstrates how to use WPF as a GUI - although its in C# I am sure its not too difficult to translate that to VB.NET. One trick you could try is to compile the project and load it into Reflecor (not sure if IL Spy supports multiple langauges) and display the byte-code as it were VB.NET.

The WpfControlWrapper<T> class adapts the WPF UserControl to work with the Plugin Editor object.
https://vstnet.codeplex.com/SourceControl/changeset/view/71210#358057

Note that the sample defaults to WinForms. Read the readme.txt and execute the steps described there.
https://vstnet.codeplex.com/SourceControl/changeset/view/71210#358058

Hope it helps.
Apr 26, 2013 at 8:21 AM
Thanks, I managed to compile the example but I get this error when I run the plugin

Image
Coordinator
Apr 26, 2013 at 10:20 AM
The EditorControl.AddLine method is called on a different thread as the thread that created the control.

You can fix this by using Dispatcher.Invoke.

I will fix it also in the source code.
Thanx.
Coordinator
Apr 26, 2013 at 10:21 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Apr 26, 2013 at 2:54 PM
Ok thanks