Jump to: navigation, search

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


Line 1: Line 1:
 
{{UnderConstructionStart}}
 
{{UnderConstructionStart}}
  
Since version 5.1 {{Version/ServerSince|5.1}} it is possible to inject UI into {{UBIK}} Studio.
+
Since version 5.1 {{Version/ServerSince|5.1}} it is possible to inject UI into {{UBIK}} Studio.<br>
The injected UI can be displayed inside a User Control and or Window.
+
The injected UI can be displayed inside a User Control and or Window.<br>
 
+
This article will help you to inject your UI!<br>
 
<!-- DO NOT REMOVE THIS -->{{Template:HowTo/Begin}}<!-- DO NOT REMOVE THIS -->
 
<!-- DO NOT REMOVE THIS -->{{Template:HowTo/Begin}}<!-- DO NOT REMOVE THIS -->
 
 
= User Control =
 
= User Control =
The existing User Control list can be extended to provide additional controls.
+
The existing User Control list can be extended to provide additional controls.<br>
==== Implementation ====
+
[[File:ControlDropDown.png|thumb|left|220px|Extended user control list]] <br><br><br><br><br><br><br><br><br><br><br><br><br><br>
Paste your User Control into your plugin solution.
+
=== Implementation ===
Make your plugin implement IUBIKEnvironmentControl and add the export.
+
1. Paste your UserControl into your plugin solution.<br>
<syntaxhighlight lang="python">
+
2. Make your UserControl implements IUBIKEnvironmentControl and add the export.<br>
 +
<syntaxhighlight lang="csharp">
 
[Export(typeof(IUBIKControl))]
 
[Export(typeof(IUBIKControl))]
public partial class CtrlAtelierHost : UserControl, IUBIKEnvironmentControl
+
public partial class TestUserControl: UserControl, IUBIKEnvironmentControl
 
</syntaxhighlight>
 
</syntaxhighlight>
The user control now has a property Description and Image.
+
3. The user control now has a property Description and Image.<br>
The text of description and the image will show up in the User Control List.
+
4. Set the properties in the constructor of the User Control. 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.
+
<syntaxhighlight lang="csharp">
 
+
  public TestUserControl()
[[File:ControlDropDown.png|thumb|220px|Extended user control list]]
+
  {
 
+
      InitializeComponent();
 +
      Description = "test control";
 +
      Image = image;
 +
  }
 +
</syntaxhighlight>
 +
5. After making the changes make sure to update the plugin in the injection folder.<br><br>
  
 
= Window =  
 
= Window =  

Revision as of 07:12, 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.
This article will help you to inject your UI!

[edit]

User Control

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

Extended user control list














Implementation

1. Paste your UserControl into your plugin solution.
2. Make your UserControl implements IUBIKEnvironmentControl and add the export.

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

3. The user control now has a property Description and Image.
4. Set the properties in the constructor of the User Control. The text of description and the image will show up in the User Control List.

  public TestUserControl()
  {
      InitializeComponent();
      Description = "test control";
      Image = image;
  }

5. After making the changes make sure to update the plugin in the injection folder.

Window

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

Injected button