protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(Resource.Layout.activity_calc); int summandOne = Intent.Extras.GetInt("summandOne"); int summandTwo = Intent.Extras.GetInt("summandTwo"); var calculator = new Calculator(); int result = calculator.Sum(summandOne, summandTwo); var textViewResult = FindViewById<TextView>(Resource.Id.textViewResult); textViewResult.Text = result.ToString(CultureInfo.InvariantCulture); }
public override void ViewDidLoad() { base.ViewDidLoad(); View.Frame = UIScreen.MainScreen.Bounds; View.BackgroundColor = UIColor.White; View.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; Title = "Result"; CreateUI(); var calculator = new Calculator(); int result = calculator.Sum(_summandOne, _summandTwo); _uiTextView.Text = result.ToString(CultureInfo.InvariantCulture); }