I forgot to mention that the performance part of this video was heavily inspired by this blog post by XamGirl! xamgirl.com/stop-doing-isvisibletrue-false-to-show-hide-views-in-runtime-in-xamarin-forms
Thanks. This works great. Performance has improved. I called by class RenderThis instead of If. If you think someone out there has introduced a better way of doing this since you posted this video, please do let us know.
This is great. I managed to implement it with the mvvm pattern (using the community toolkit) by binding the condition to a boolean property on the viewmodel which I set on page load. Works perfectly. Thanks again!
This is amazing, I never knew about this issue and Im actually facing it, I have two CollectionViews and Im showing only one of them but in terms of performance Im sure this will be an issue. but with your solution its gonna avoid that. Thank you bro and I hope to see more MAUI Content.
hey random question could this be extrapolated to a three way validation i.e., if condition == 1 => display view1 else if condition == 2 => display view2 else => display view3 btw great video I can see this becoming a game changer in the MAUI community
You're conflating terminology somewhat: the label isn't being rendered. The problem comes from it still being in the logical tree and thus loaded like other controls (as stated with the listview example)
@@SingletonSean recently I spent 30 min fixing a bug in my code. Bug was "ID" instead of "Id". Even if it's not ambigous for code itself, naming class "If" is dangerous. But it's only example so ¯\_(ツ)_/¯
That's way too much code and logic in your xaml. Your xaml should be lightweight. How bloated would this be if you have hundred fields. You can't reuse this as well in other forms without copying large chunks of mess.