2013-02-15 36 views
1

我有一個地理定位器的問題,當我將MovementThreshold設置爲1時,一切正常,但如果我將它設置爲0,那麼我在收聽位置事件變化時收到Abort錯誤Geolocator造成中止PositionChanged事件

Geolocator Locator = new Geolocator(); 
Locator.DesiredAccuracy = PositionAccuracy.High; 
Locator.MovementThreshold = 0; 
Locator.PositionChanged += Locator_PositionChanged; // Error occours here but does not occour if Threshold >= 1 

任何想法爲什麼?

回答

1

將MovementTreshold設置爲0與無法設置它相同,如果未設置,則不能使用位置/狀態更改的事件。在這種情況下,你總會得到一個異常。

+0

啊所以它不像GeoWatcher那樣將其設置爲零,它會導致位置變化不斷髮射? – Gaz83 2013-02-15 11:42:11

+0

您可以使用ReportInterval設置從GeoLocator獲取數據的時間間隔。也許它可能對你更好 – 2013-02-15 11:48:46

+0

我現在就試試吧,歡呼 – Gaz83 2013-02-15 12:25:05

相關問題