private void ComputeDirections_Click(object sender, RoutedEventArgs e)
{
//hide the directions panel
DirectionsPanel.Visibility = System.Windows.Visibility.Collapsed;
string address = String.Empty;
//if the address does not contain the name of the city, we will add it
if (!this.AddressTextBox.Text.Contains(CurrentCity.Name))
{
address = String.Format("{0},{1}", this.AddressTextBox.Text, CurrentCity.Name);
}
else
{
address = this.AddressTextBox.Text;
}
//call the geocode
if (_currentState == BikeInCity.State.Directions)
{
_serviceCaller.GeocodeAddress(address, GeocodeForDirectionsCompleted);
}
else
{
_serviceCaller.GeocodeAddress(address, GeocodeForStationsCompleted);
}
}