How to make custom properties in Uno accessible from outside?

Let’s say I have this CustomElement.ux

<Panel ux:Class="CustomElement" ux:AutoCtor="false">

</Panel>

And a class for it:

public partial class CustomElement
{
    private float _MyValue = 0f;
    public float MyValue 
    {
        get{
            return _MyValue;
        }
        set
        {
            debug_log value;
            _MyValue = value;
        }
    }

    public CustomElement()
    {
        InitializeUX();
    }

}

How can I make that MyValue available from outside of this element. Like:

<CustomElement MyValue="1" />

Hi,

This already works. However, this CustomElement can not be defined in the same project as where it is used. If you want to use Uno code-behinds, you have to move reusable components out into a separate Uno project and reference that project from your main project.

The reason is that the UX compiler processes UX files based on the Uno code in the project, then generates new Uno code. This CustomElement class consists partially of pre-defined and partially generated Uno code, and hence the combined result can not feed back into the UX compilation step.

However, you can make components in pure Uno and use that in UX within the same project.