Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 4 #7

Open
samosim opened this issue Feb 15, 2020 · 0 comments
Open

Chapter 4 #7

samosim opened this issue Feb 15, 2020 · 0 comments

Comments

@samosim
Copy link

samosim commented Feb 15, 2020

I tested the code presented in Chapter 4 on Android 10 and it does not work properly. When I press New button in toolbar, NewDetail page is opened but it stuck. The problem causes the following function:

public override async void Init()
{
try
{
var coords = await _locService.GetGeoCoordinatesAsync();
Latitude = coords.Latitude;
Longitude = coords.Longitude;
}
catch (Exception)
{
// TODO: handle exceptions from location service
}
}

The _locService.GetGeoCoordinatesAsync() method is executed properly but after that Latitude and
Longitude properties start updating infinitely which causing unresponsiveness. I do not understand why OnPropertyChanged() event is called infinitely. If I remove both properties then app works fine.

Update:

I spend some time on this problem and I think that I figure out what was the cause of the problem. By default, I use the Slovenian language and we write decimal numbers with a comma and not with a dot. if I change the language to English then everything works fine. To solve this problem, I think that I have to apply some kind of culture to appropriate binding. I will appreciate any kind of help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant