Loading XAML - nicklikescoffee/UltimateUiPlugin GitHub Wiki
In Ultimate UI you can load XAML as the user interface or replace the browser with XAML code. Replacing the browser allows you to use an HTML layout as the UI and then use XAML controls below the HTML layout. This will allow you to do things like use a UI builder for your main layout while still using controls such as the DataGrid below it.
In this tutorial we are going to focus on loading XAML as the UI. Replacing the browser with XAML is basically the same process but with fewer options.
First, we need some XAML to load:
<TextBlock Text="Hello World"/>
And now we can paste that into the UI Load XAML command:
plugin command("UltimateUI.dll", "UI Load XAML", "<TextBlock Text=\"Hello World\"/>", "False", "False", "False", "BaseLight", "Blue")
Note that we do not need to paste in code for a Window or UserControl, in fact, you should not paste this in. Behind the scenes Ultimate UI is going to load a UserControl for you and in that UserControl is a Grid. So you can just paste a single line of XAML as we did above and it will still work.
You also should not subscribe to events inside of your XAML code. Instead, use the commands that Ultimate UI provides to subscribe to events.
Now that we have a line of XAML you will notice that it takes up very little space for the UI. Sometimes this is desirable, however, oftentimes you will want your UI to take up the entire space of the application. The first step towards doing this is to set the parameter Enable Full Height to True.
plugin command("UltimateUI.dll", "UI Load XAML", "<TextBlock Text=\"Hello World\"/>", "True", "False", "False", "BaseLight", "Blue")
Enable Full Height will allow your UI to consume the maximum amount of space. This is important because if your user resizes the application while this is set to False then they may see that light blue color that is a part of Ubot. To get rid of this blue color try using a Control such as a Grid with a background color as the root Control for your UI.
plugin command("UltimateUI.dll", "UI Load XAML", "<Grid Background=\"Red\"> <TextBlock Text=\"Hello World\"/> </Grid>", "True", "False", "False", "BaseLight", "Blue")
Enabling full height will hide the browser, so only do this on applications where you do not want the user to see the browser.
Enabling full height will automatically figure out for you if you are inside of Ubot, or if you are in compiled, or if there is a menu or run bar or both and then figure out the height.
In many applications, you may wish to hide the run bar for your compiled application. Especially when you want to remove all visual traces of a Ubot Studio application.
However, doing so will leave a 1 pixel line at the top of your UI. In order to remove this line you can choose to set the parameter Hide Run Bar to be True.
When you set Hide Run Bar to be True the run bar will be hidden regardless if you chose to hide it during compilation or not. So only set this option to be True if you plan on hiding the run bar.