You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm unfortunately finding so many simple problems with Maui. I'm not really sure how it's come this far without other people finding these problems. Maybe I'm doing something wrong. Anyway, here's another problem:
A bound switch control triggers the Toggled event on load, on manual input and on page closing. This is to be expected as it triggers whenever the toggled value changes, however, there's no way to determine whether the input is user-initiated.
You could have something like this, but it doesn't fully work:
` Switch sw = (Switch)sender;
Word w = (Word)((Microsoft.Maui.Controls.Switch)sender).BindingContext;
if (w != null)
{
//The page is not closing, it's either loading or loaded.
if (!_loaded)
{
//Page is loading up, so don't attempt any updates.
}
else
{
//The page has loaded up, but it may still be populating the switches.
//For the first x seconds, it's best not to update anything.
int t = Database.Connection.Update(w);
}
}
else
{
//If it's null, then the object has been disposed of (the page is closing), so don't attempt any updates.
}`
The problem with this is that the listview is loaded before all the switches are populated with thei togged state values.
Basically, how do we know when the switch controls have been loaded with the initial values?
The switch values are filled with their initial values. Each time the toggled event is triggered.
A switch value is modified by a human. Each time the toggled event is triggered.
The switch values are emptied on close. Each time the toggled event is triggered.
How are we supposed to deal with this?
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
9.0.0-preview.3.10457
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
I was not able test on other platforms
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered:
Description
Hello all,
I'm unfortunately finding so many simple problems with Maui. I'm not really sure how it's come this far without other people finding these problems. Maybe I'm doing something wrong. Anyway, here's another problem:
A bound switch control triggers the Toggled event on load, on manual input and on page closing. This is to be expected as it triggers whenever the toggled value changes, however, there's no way to determine whether the input is user-initiated.
You could have something like this, but it doesn't fully work:
` Switch sw = (Switch)sender;
The problem with this is that the listview is loaded before all the switches are populated with thei togged state values.
Basically, how do we know when the switch controls have been loaded with the initial values?
How are we supposed to deal with this?
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
9.0.0-preview.3.10457
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
I was not able test on other platforms
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: