I am building a GPS-related application that displays the coordinates amongst other calculations. My demo code is setup to fire the events every second.
Whenever I update the main page UI (say, a textbox with the calculated Latitude), it works fine.
The problem is if I try to "flick" from one side to the other side, to change the page. While in the process of "flicking", if the textbox was to update, it jumps the main page back into view.
Kind of hard to explain in text without a video. But imagine click-n-holding, and draging the panoramic screen just a little - say, to peek at the next page but not flipping yet. Well, if the textbox was to update during that time, you'd loose your mouse-click-hold, and it would jump back to the main page.
Once you DO get to the next page, it stays and I can see the overflow updating from the previous page. No big deal there. But it's just trying to get to that next page.
I'm new to WP7/Silverlight, so I've been trying to use the Dispatcher to make things more responsive. No matter what I do (using the Dispatcher or not), this always happens. So, I am guessing this has to do with the UI being updated.
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;
}
When any of these textboxes are updated, the screen "jumps" back to the main page. Kind of a bad experience.
Maybe that is normal? Is there an event to hook into to knowing that the user is trying to "slide" to the next page?
Thanks in advance.