xeladu
Sep 13, 2023

--

Yes, of course!

You need the self binding because your control inherits the binding context of the parent control and this binding context does not have your properties that you defined in code behind. To make the binding work, the self binding approach is commonly used.

.NET MAUI has no DependencyProperties but you can just use BindableProperties. Same old in new shoes :)

View models are not commonly used for custom controls because there can be problems with the binding context (e.g. properties are null) when not set correctly. With the .xaml and .xaml.cs file, there is already a good separation between UI and logic.

--

--

xeladu
xeladu

Written by xeladu

Flutter and Firebase expert, blogger on QuickCoder.org, find my ebooks and freebies on shop.quickcoder.org, contact me on me.quickcoder.org!

No responses yet