private void btnCalculate_Click(object sender, RoutedEventArgs e) { //TODO try { double result; result = BusinessLogicWindow.CalculateArea(double.Parse(txtWidht.Text), double.Parse(txtHeight.Text)); txtAla.Text = result.ToString(); double result2; result2 = BusinessLogicWindow.CalculatePerimeter(double.Parse(txtWidht.Text), double.Parse(txtHeight.Text)); txtPiiri.Text = result2.ToString(); double result3; result3 = BusinessLogicWindow.CalculateKarmi(double.Parse(txtWidht.Text), double.Parse(txtHeight.Text), double.Parse(txtKarmi.Text)); txtKA.Text = result3.ToString(); } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { //yield to an user that everything okay } }