Jump to: navigation, search

Difference between revisions of "HowTo:Inject UI into UBIK Studio"


Line 9: Line 9:
 
The existing User Control list can be extended to provide additional controls.
 
The existing User Control list can be extended to provide additional controls.
 
==== Implementation ====
 
==== Implementation ====
It is enough to add the following code to your UserControl
+
Paste your User Control into your plugin solution.
 
+
Make your plugin implement IUBIKEnvironmentControl and add the export.
 
<syntaxhighlight lang="python">
 
<syntaxhighlight lang="python">
 
[Export(typeof(IUBIKControl))]
 
[Export(typeof(IUBIKControl))]
 
public partial class CtrlAtelierHost : UserControl, IUBIKEnvironmentControl
 
public partial class CtrlAtelierHost : UserControl, IUBIKEnvironmentControl
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
The user control now has a property Description and Image.
 +
The text of description and the image will show up in the User Control List.
 +
After making the changes make sure to update the plugin in the injection folder.
  
 
[[File:ControlDropDown.png|thumb|220px|Extended user control list]]
 
[[File:ControlDropDown.png|thumb|220px|Extended user control list]]

Revision as of 06:44, 16 June 2026

Wiki Under Construction Start.PNG

Since version 5.1 it is possible to inject UI into UBIK® Studio. The injected UI can be displayed inside a User Control and or Window.


[edit]

User Control

The existing User Control list can be extended to provide additional controls.

Implementation

Paste your User Control into your plugin solution. Make your plugin implement IUBIKEnvironmentControl and add the export.

[Export(typeof(IUBIKControl))]
public partial class CtrlAtelierHost : UserControl, IUBIKEnvironmentControl

The user control now has a property Description and Image. The text of description and the image will show up in the User Control List. After making the changes make sure to update the plugin in the injection folder.

Extended user control list


Window

A new button can be added to the UI and open the injected UI

Injected button