Witam. Mam aplikacje MVVM wykorzystującą gps i mapy. Pojawia mi się błąd w tym zdarzeniu
void gps_PositionChanged(Geolocator sender, PositionChangedEventArgs args)
{
this.Latitude = args.Position.Coordinate.Latitude.ToString();
}
Kod znajduje sie ViewModel strony a właściwosć Latitude jest zbindowana z textboxem.
Klasa ViewModel dziedziczy bo klasie ViewModelBase gdzie po uruchomienu aplikacji kompilator staje tu
protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
{
var handler = this.PropertyChanged;
if (handler != null)
{
handler(this, e);
}
}
An exception of type 'System.UnauthorizedAccessException' occurred in System.Windows.ni.dll but was not handled in user code
Co jest nie tak? Czy to coś z wątkami? Jak to nalezy prawidłowo zrobić?