If I keep navigating back and forth or open a new window, the toggle command is called for both windows, i.e. the binding remains active regardless of whether I navigate back or close the window.
Steps to Reproduce
start the application under Windows
click on the “Open window” button
click on the “Toggle” button in the new window
in the console you can see that “Toggled to True” is only called once.
close the window
repeat the steps from 2 to 3 and you will see that it is called twice next time, 3 times etc.
I know it's because of the “TestData” class, because this class only has one instance. If the behavior is intentional, which I can't imagine since a new window is always created and the old bindings should be lost, then it would be very nice to know how to work around this and still use the same “TestData” class.
Description
I have the following problem,
If I keep navigating back and forth or open a new window, the toggle command is called for both windows, i.e. the binding remains active regardless of whether I navigate back or close the window.
Steps to Reproduce
Link to public reproduction project repository
https://github.com/FullDevStudio/MauiApp1.git
Version with bug
8.0.90 SR9
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Windows, I was not able test on other platforms
Affected platform versions
net8.0-windows10.0.19041.0
Did you find any workaround?
I know it's because of the “TestData” class, because this class only has one instance. If the behavior is intentional, which I can't imagine since a new window is always created and the old bindings should be lost, then it would be very nice to know how to work around this and still use the same “TestData” class.
the following code fixes the following behavior
{ testPage.BindingContext = null; };
Relevant log output
No response