C
C#8mo ago
archie

❔ Binding method called multiple times

Hello, I'm new to MAUI. I have face the following strange issue during development my app: Project with a demonstration of the issue: https://github.com/archie1602/MauiTest The application consists of two pages: MainPage and SettingsPage On the SettingsPage: I have a control witch Switch, which I binded to the SettingsViewModel via EventToCommandBehavior from CommunityToolkit.Maui. When switching the toggle switch, the OnBroadcastingToggled method is started. It works fine. But: If, for example, I return to the MainPage page and go back (again) to the SettingsPage, and then switch the slider again (switch), the method OnBroadcastingToggled will be called 2 times. If I do it 5 times, then he will be called 5 times and so on... My question is why is it called multiple times instead of one? P.S. if I remove the binding properties IsToggled="{Binding IsBroadTogl}", then this problem disappears. But it's weird... Maybe I'm doing the wrong binding? Or is there some kind of double binding going on? Ref: https://github.com/archie1602/MauiTest/blob/master/SettingsPage.xaml Thanks.
GitHub
GitHub - archie1602/MauiTest
Contribute to archie1602/MauiTest development by creating an account on GitHub.
GitHub
MauiTest/SettingsPage.xaml at master · archie1602/MauiTest
Contribute to archie1602/MauiTest development by creating an account on GitHub.
No description
2 Replies
archie
archie8mo ago
Any help, please
Accord
Accord8mo ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.