private void FindAddressButton_Click(object sender, RoutedEventArgs e)
{
graphicsLayer.ClearGraphics();
AddressBorder.Visibility = Visibility.Collapsed;
ResultsTextBlock.Visibility = Visibility.Collapsed;
Locator locatorTask = new Locator("http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer");
locatorTask.AddressToLocationsCompleted += LocatorTask_AddressToLocationsCompleted;
locatorTask.Failed += LocatorTask_Failed;
AddressToLocationsParameters addressParams = new AddressToLocationsParameters()
{
OutSpatialReference = MyMap.SpatialReference
};
Dictionary<string, string> address = addressParams.Address;
if (!string.IsNullOrEmpty(Address.Text))
address.Add("Address", Address.Text);
if (!string.IsNullOrEmpty(City.Text))
address.Add("City", City.Text);
if (!string.IsNullOrEmpty(StateAbbrev.Text))
address.Add("Region", StateAbbrev.Text);
if (!string.IsNullOrEmpty(Zip.Text))
address.Add("Postal", Zip.Text);
locatorTask.AddressToLocationsAsync(addressParams);
}