I am creating a GPS-related application that displays the coordinates among other calculations. My demo code is set up to trigger events every second.
Whenever I update the user interface of the main page (say, a text field with calculated latitude), it works fine.
The problem is that I am trying to “click” from one side to the other to change the page. During the “click” process, if the text field was to be updated, it jumps to the main page back to the view.
It is hard to explain in the text without the video. But imagine a click-n-holding and a little look at the panoramic screen - say, look at the next page, but not turn over. Well, if the text field were to be updated during this time, you would lose the mouse click and it will return to the main page.
As soon as you go to the next page, it will remain, and I see the overflow update from the previous page. There are not many. But he is just trying to get to the next page.
I am new to WP7 / Silverlight, so I tried to use the dispatcher to make it more responsive. No matter what I do (using the Dispatcher or not), this always happens. So, I assume that this is related to updating the user interface.
A little code always helps:
void GeoWatcher_PositionChanged(object sender,
GeoPositionChangedEventArgs<GeoCoordinate> e)
{
Deployment.Current.Dispatcher.BeginInvoke(() => MyPositionChanged(e));
}
void MyPositionChanged(GeoPositionChangedEventArgs<GeoCoordinate> e)
{
var model = GeoProcessor.GetPosition(e.Position);
latitude.Text = model.Latitude;
longitude.Text = model.Longitude;
altitude.Text = model.Altitude;
accuracy.Text = model.Accuracy;
direction.Text = model.Direction;
speed.Text = model.Speed;
speedAvg.Text = model.SpeedAvg;
}
- , "" . .
, ? - , , "" ?
.