in TrafficApp/MainPage.xaml.cs [556:576]
private void Flyout_Closed(object sender, object e)
{
// Do nothing if the flyout is closing in order to enter map selection mode.
if (this.isMapSelectionEnabled) return;
// If a new location is still in edit, then the user has light-dismissed
// the editor without saving. In this case, delete the new location.
else if (this.isNewLocationInEdit)
{
this.isNewLocationInEdit = false;
this.Locations.RemoveAt(this.Locations.Count - 1);
}
// If the user has repositioned an existing location but has not yet
// saved the changes, revert the position to the original one.
else if (this.isExistingLocationBeingRepositioned)
{
this.isExistingLocationBeingRepositioned = false;
this.locationInEdit.Position = this.locationInEditOriginalPosition;
}
}