Jump to: navigation, search

Changes


HowTo:Inject UI into UBIK Studio

422 bytes added, 16 June
===Goal===
The goal is to extend the existing user control list with the injected user control.<br>
Every time you drag an instance to a new window, the mentioned list with the new control will show pops up.
[[File:InjectedUserControl.png|thumb|left|735px|Extended user control list]] <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
=== Implementation ===
1. Paste your UserControl in the plugin solutionCreate or reuse a .Net library (DLL) project - it doesn't have to be a {{UBIK}} Module.<br>2. Make your Add the designated control as a class deriving from System.Windows.Forms.UserControl implements to the project.<br>3.Implement the interface IUBIKEnvironmentControl and for the control.<br>4. For automatic injection, add the export"Export" Attribute with the "IUBIKControl" type parameter to the designated control.<br>
<syntaxhighlight lang="csharp">
[Export(typeof(IUBIKControl))]
public partial class TestUserControl: UserControl, IUBIKEnvironmentControl
</syntaxhighlight>
35. The user control now has a property Description and Image.<br>46. 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.
<syntaxhighlight lang="csharp">
public TestUserControl()
}
</syntaxhighlight>
57. After making Provide the changes make sure to update the plugin updated DLL containing your UserControl in the injection UBIK® Studio's [Injection_Management#Injection_Folder.28s.29|Injection] folder.<br>68. When starting {{UBIK}} After connecting to a database with UBIK® Studio , the new user control will show up can be accessed by right-clicking or dragging a UBIK® object on a tab header - it should appear in the listof possible controls.<br><br>
= Window =
283
edits