Last modified on 16 June 2026, at 13:53

Inject UI into UBIK Studio

Revision as of 13:53, 16 June 2026 by DAK (Talk | contribs)

Wiki Under Construction Start.PNG

Since version 5.2 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

Goal

The goal is to extend the existing user control list with the injected user control.
Every time you drag an instance to a new window, the mentioned list pops up.

Extended user control list





















Implementation

1. Create or reuse a .Net library (DLL) project - it doesn't have to be a UBIK® Module.
2. Add the designated control as a class deriving from System.Windows.Forms.UserControl to the project.
3.Implement the interface IUBIKEnvironmentControl for the control.
4. For automatic injection, add the "Export" Attribute with the "IUBIKControl" type parameter to the designated control.

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

5. The user control now has a property Description and Image.
6. 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;
  }

7. Provide the updated DLL containing your UserControl in UBIK® Studio's Injection folder.
8. After connecting to a database with UBIK® Studio, the new control can be accessed by right-clicking or dragging a UBIK® object on a tab header - it should appear in the list of possible controls.

Window

Overview

A additional button can be added to the tool bar

Injected button











Implementation

1. Paste your Window in the plugin solution.
2. Create a new class that implements IUBIKWindowFactory.

[Export(typeof(IUBIKWindowFactory))]
public class TestWindowFactory : IUBIKWindowFactory
{
    public Bitmap Icon => Image;

    public string Label => "Test";

    public Window GetWindow(UBIKEnvironment env)
    {
        return new TestWindow(env);
    }
}

3. Assign values to the "Icon" and "Lable" properties they will be used for the button.
4. In the GetWindow Method return the window that you moved to the solution.
5. After making the changes, make sure to update the plugin in the injection folder.
6. When starting UBIK® Studio the new button will show up in the tool bar.