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> |
| − | + | [[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 | + | === Implementation === |
| − | Make your | + | 1. Paste your UserControl into your plugin solution.<br> |
| − | <syntaxhighlight lang=" | + | 2. Make your UserControl implements IUBIKEnvironmentControl and add the export.<br> |
| + | <syntaxhighlight lang="csharp"> | ||
[Export(typeof(IUBIKControl))] | [Export(typeof(IUBIKControl))] | ||
| − | public partial class | + | 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() | |
| − | + | { | |
| − | + | 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
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!
