Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Two way binding with a converter causing an infinite loop

$
0
0

I have a field
public string Test
{
get
{
return _test;
}
set
{
if (value != _test)
{
_test = value;
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs("Test"));
}
}
}
which is bound in xaml

This works fine without the converter however as soon as I add the converter back in regardless of the code in the converter (which is why i havnt bothered posting the code for it, I have even tried it with convert and convert back both returning empty strings) No matter what happens as soon as I enter something into the field it starts an infinite loop of hitting ConvertBack. Each time it adds whatever i entered again. E.g. if I enter 1 into the entry it hits ConvertBack with value 1 and works fine. It then hits ConvertBack again with 11, it then hits it again with 111

Even if I close the app it carries on entering ones into a search window until I press some other button and can not figure out why


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>