Custom native control wrappers


I’m trying to upgrade DatePicker from old Fuse to 0.20. I’ve followed the guide here

First of all this gives me an error:

extern(!iOS) public class MySlider: LeafView

After replacing LeafView with Panel I still get an error when trying to compile for iOS:

.uno/ E3104: 'iOSDatePicker' does not contain a member called 'Name'. Could you be missing a package reference?
.uno/ E3104: 'iOSDatePicker' does not contain a member called 'Bindings'. Could you be missing a package reference?
.uno/ E2047: No implicit cast from 'iOSDatePicker' to Uno.UX.PropertyObject

My attempt is here:


Use LeafView, not Panel. What

Second, LeafView is currently not a Node, so it doesn’t support bindings when it is the root element in a template or calss (as of 0.21). I see though that we should probably make View extend Node to support this use case.

Currently, the native views are implemented by passing an interface to the host down to the implementation and doing the bindings manually in Uno code. Here is how the iOS slider is implemented:

Also, check this out :slight_smile:

This is what uno says when I enter LeafView for extern(!iOS): E3114: There is nothing named 'LeafView' accessible in this scope. Did you perhaps misspell 'ILeafView' (as in Fuse.Controls.Native.ILeafView)?  Could you be missing a package reference?

It would be good if you also describe what you mean by host in this context.

Hi Bjørn-Olav,

Sorry that this thread got forgotten. Do you still have this problem?


Yes. I still don’t know how to implement this in Fuse 0.2x, and have not seen any working best practice examples.

Did you look at the sample?

Yes. That does not follow the pattern outlined here: Custom native control wrappers for UX markup, and does not use ux:Template, or ux:Class.

The Native.DatePicker class extends Panel, and not LeafView as the documentation says it should, and which @duckers also says should work.

Also I would like to have a description of what you mean with host.

“host” is probably just referring to the code in my example