Why DataTemplate executes code more than 1 time? #20784
Unanswered
criss02-cs
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to develop a Calendar in .NET MAUI, and I'm using a CarouselView to display the list of months. Inside I use the ItemTemplate property to define the graphic interface for each month. I associate the ItemTemplate with code and when I try to open the page it takes a really long time to open, and I saw that the problem lies when I render the graphic interface of my DataTemplate, but in the meantime I saw that that code is executed 3/4 times.
This is MonthView, which I use on DataTemplate
And now che component where is the CarouselView
You can clearly see that the code is executed several times, does anyone know why? Or how can I solve it?

Beta Was this translation helpful? Give feedback.
All reactions