Jump to: navigation, search

Changes


HowTo:Inject UI into UBIK Studio

811 bytes added, 16 June
[[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 ===
1. Paste your UserControl into your in the plugin solution.<br>
2. Make your UserControl implements IUBIKEnvironmentControl and add the export.<br>
<syntaxhighlight lang="csharp">
= Window =
A new additional button can be added to the UI and open the injected UItool bar[[File:InjectedButton.png|thumb|280pxleft|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 -->
283
edits