AzureMLDemo.MainPage.GetEstimate_Click C# (CSharp) Method

GetEstimate_Click() private method

Handler for the click event of the "Get Estimate" button.
private GetEstimate_Click ( object sender, RoutedEventArgs e ) : void
sender object
e Windows.UI.Xaml.RoutedEventArgs
return void
    private async void GetEstimate_Click(object sender, RoutedEventArgs e)
    {
        try
        {
            // gets estimate from Azure ML service and sets it to result TextBlock
            var price = await CallAzureML(tbxMake.Text, tbxBodyStyle.Text, slWheelBase.Value, tbxNumberOfCylinders.Text, (int)slEngineSize.Value, (int)slHorsepowers.Value, (int)slPeakRPM.Value, (int)slHighwayMPG.Value);
            tbResult.Text = String.Format("You are lucky!\nToday it is as cheap as {0:c}. Don't miss your chance!", price);
        }
        catch (Exception ex)
        {
            // Shows error in result TextBlock
            tbResult.Text = String.Format("Oops! Something went wrong.\nThis can be helpful:\n{0}", ex.ToString());
        }
    }