I have been trying out Uno recently. It's a great development tool for cross-platform applications. One thing that new converts have always questioned, is the lack of a forms designer. Having written Xamarin Controls to help with this in Xamarin, I decided to do the same for Uno.
We haven't come up with a forms designer, but we have come up with a way of generating the XAML to create controls in your code.
We are hoping that this is helpful for existing Uno developers, but will also help those new to the platform easily generate controls, which they can then tune to their own requirements.
Released as an add-in to Visual Studio, Uno Controls will allow you to choose from a pre-set of properties for a control, and will generate the XAML and insert it into your XAML code.
Currently we cater for adding the code for the following controls:-
- Date/Time Picker
- Radio Buttons
- Check Box
Simply right-click in your XAML code window to get a menu of controls.
Select the control you want to generate and a 'selection box' appears, allowing you to choose properties for your control. In this case we have chosen 'TextBlock'.
If you are using a 'style' for your TextBlock, you can enter it in the 'style' box, and if you have a binding context, again, enter it into the box, and it will replace the 'text' entry in the code.
The parameters persist between sessions, but if you right click on the 'group box' containing all the controls, you can go back to the default parameters.
If you select 'Control in Grid', 3 more fields appear, allowing you to select a row, column and column span, to place your control in a grid. This is available in all the controls, except the grid control.
If we change the name above to lblWelcome, and leave all the other parameters as they are, click on OK, the following code is inserted your XAML:-
Which generates this on your form:-
The screenshot below shows most of the controls - this is completely generated code from the Uno controls add-in. Click on the image to see full size.
Please let us know if you have any suggestions for additional controls, or the existing controls.