public override void ViewDidLoad() { base.ViewDidLoad(); if (_order != null) { if (_totalAmount <= 0) { _totalAmount = _order.ComputeOrderTotal(); } _paymentUssd = $"{_order.USSD_NUMBER}{_totalAmount}#"; Title = "Order Payment"; TxtOrderNumber.Text = _order.ORDER_ID.ToString(); TxtOrderTotal.Text = _totalAmount.ToString("C", CultureInfo.CreateSpecificCulture("en-US")); LblOrderSummary.Text = $"Pay for order number :{_order.ORDER_ID}"; //lblHelpLine.Text = $"Call us on {UserSession.HelpLine()}"; LblUssdNumber.Text = $"Payment Number is :{_paymentUssd}"; BtnPayOrder.SetTitle($"Tap to pay for order number :{_order.ORDER_ID}", UIControlState.Normal); TxtOrderTotal.Enabled = false; TxtOrderNumber.Enabled = false; BtnPayOrder.TouchUpInside += (e, s) => { //let us launch the dialler var launched = _messagingActions.MakePhoneCall(_paymentUssd); if (!launched) { MessagingActions.ShowAlert("Dialler Not opened", "Unable to open dialling keypad on this device"); Analytics.TrackEvent($"Unable to launch dialler for user id {UserSession.GetUserId()}"); } }; BtnClose.TouchUpInside += (e, s) => { //dismiss the view controller DismissModalViewController(true); }; } }
void ReleaseDesignerOutlets() { if (BtnClose != null) { BtnClose.Dispose(); BtnClose = null; } if (BtnPayOrder != null) { BtnPayOrder.Dispose(); BtnPayOrder = null; } if (LblOrderSummary != null) { LblOrderSummary.Dispose(); LblOrderSummary = null; } if (LblUssdNumber != null) { LblUssdNumber.Dispose(); LblUssdNumber = null; } if (TxtOrderNumber != null) { TxtOrderNumber.Dispose(); TxtOrderNumber = null; } if (TxtOrderTotal != null) { TxtOrderTotal.Dispose(); TxtOrderTotal = null; } }