07-27-2023, 03:20 PM
Ab4d.SharpEngine does not support binding. The first reason for that is performance - binding usually requires reflection and this may be very slow. Another reason is that binding is platform specific - WPF uses its own binding, WinUI and Avalonia also have their own.
Also, to enable binding support, the objects need to be derived from some specil objects - for example in WPF from FrameworkElement and the properties need to be defined as DepandecyProperties. In this way it would be possible to provide binding for some of the objects. For example for SphereNode it would be possible to have Radius, CenterPosition and Material as DepandencyProperty. But in this case getting and setting the Radius value would be significantly slower for all users than in the current solution when getters and setters are standard properties.
What is more, each MVVM user may requred different kind of binding.
Therefore I would recommend you to create your own classes that would support binding in a way thar you desire. Those classes would then cresate and upate the Abd.SharpEngine's SceneNode objects.
Also, to enable binding support, the objects need to be derived from some specil objects - for example in WPF from FrameworkElement and the properties need to be defined as DepandecyProperties. In this way it would be possible to provide binding for some of the objects. For example for SphereNode it would be possible to have Radius, CenterPosition and Material as DepandencyProperty. But in this case getting and setting the Radius value would be significantly slower for all users than in the current solution when getters and setters are standard properties.
What is more, each MVVM user may requred different kind of binding.
Therefore I would recommend you to create your own classes that would support binding in a way thar you desire. Those classes would then cresate and upate the Abd.SharpEngine's SceneNode objects.
Andrej Benedik

