Difference between revisions of "HowTo:Inject UI into UBIK Studio"
| Line 9: | Line 9: | ||
[[File:ControlDropDown.png|thumb|left|220px|Extended user control list]] <br><br><br><br><br><br><br><br><br><br><br><br><br><br> | [[File:ControlDropDown.png|thumb|left|220px|Extended user control list]] <br><br><br><br><br><br><br><br><br><br><br><br><br><br> | ||
=== Implementation === | === Implementation === | ||
| − | 1. Paste your UserControl | + | 1. Paste your UserControl in the plugin solution.<br> |
2. Make your UserControl implements IUBIKEnvironmentControl and add the export.<br> | 2. Make your UserControl implements IUBIKEnvironmentControl and add the export.<br> | ||
<syntaxhighlight lang="csharp"> | <syntaxhighlight lang="csharp"> | ||
| Line 29: | Line 29: | ||
= Window = | = Window = | ||
| − | A | + | A additional button can be added to the tool bar |
| − | [[File:InjectedButton.png|thumb| | + | [[File:InjectedButton.png|thumb|left|298px|Injected button]]<br><br><br><br><br><br><br><br> |
| + | === Implementation === | ||
| + | 1. Paste your Window in the plugin solution.<br> | ||
| + | 2. Create a new class that implements IUBIKWindowFactory. | ||
| + | <syntaxhighlight lang="csharp"> | ||
| + | [Export(typeof(IUBIKWindowFactory))] | ||
| + | public class TestWindowFactory : IUBIKWindowFactory | ||
| + | { | ||
| + | public Bitmap Icon => Image; | ||
| + | public string Label => "Test"; | ||
| + | |||
| + | public Window GetWindow(UBIKEnvironment env) | ||
| + | { | ||
| + | return new TestWindow(env); | ||
| + | } | ||
| + | } | ||
| + | </syntaxhighlight> | ||
| + | 3. Assign values to the "Icon" and "Lable" properties they will be used for the button.<br> | ||
| + | 4. In the GetWindow Method return the window that you moved to the solution.<br> | ||
| + | 5. After making the changes, make sure to update the plugin in the injection folder.<br> | ||
| + | 6. When starting {{UBIK}} Studio the new button will show up in the tool bar.<br><br> | ||
<!-- DO NOT REMOVE THIS -->{{Template:HowTo/End}}<!-- DO NOT REMOVE THIS --> | <!-- DO NOT REMOVE THIS -->{{Template:HowTo/End}}<!-- DO NOT REMOVE THIS --> | ||
Revision as of 07:48, 16 June 2026
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!

