Replies: 8 comments 4 replies
-
XAML is indeed a bit limited in this regard. You can however use either code-behind of your views or go straight for MVU pattern. This way you can use c# code to apply whatever logic you need. |
Beta Was this translation helpful? Give feedback.
-
Conditional rendering is possible, but it's a little bit awkward. Let's say, you would like to render a list if you have any item, otherwise, render an empty state. |
Beta Was this translation helpful? Give feedback.
-
I would recommend not using xaml entirely, and go with writing UI in c# and community toolkit markup. Binding then becomes a breeze, conditional rendering can then be achieved with databinding |
Beta Was this translation helpful? Give feedback.
-
@lanyusan check out https://xamgirl.com/stop-doing-isvisibletrue-false-to-show-hide-views-in-runtime-in-xamarin-forms/ |
Beta Was this translation helpful? Give feedback.
-
Basically yes. Xaml lacks lot of expression capability available in React Native. You’ll never see a ternary operator in Xaml. |
Beta Was this translation helpful? Give feedback.
-
This is useful: https://m.youtube.com/watch?v=BOYySROGooM |
Beta Was this translation helpful? Give feedback.
-
Razor syntax allows to conditionally render with |
Beta Was this translation helpful? Give feedback.
-
You can use https://nalu-development.github.io/nalu/layouts.html#toggletemplate |
Beta Was this translation helpful? Give feedback.
-
Hi, we have an electron based desktop app built with react. We hit some performance issues and are thinking of rebuilding it with closer to native cross platform UI solutions.
I have been reading and experimenting MAUI. Not goanna lie that I think xaml/data binding is REALLY verbose compared to jsx and react's props + state to view model. But that is a price we are willing to pay if we choose maui.
Our react codebase uses conditional rendering of different components based on different conditions extensively, which is really easy and performant with jsx in react.
I have gone through xmal documentation and found no explicit discussion of this.
Can someone point to the right direction?
Many thanks.
Beta Was this translation helpful? Give feedback.
All reactions