Example #1
0
        partial void UIButton21_TouchUpInside(UIButton sender)
        {
            var left   = int.Parse(Left.Text);
            var right  = int.Parse(Right.Text);
            var result = CLib.Add(left, right).ToString(CultureInfo.InvariantCulture);

            Result.Text = result;
        }
Example #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            // Get our button from the layout resource,
            // and attach an event to it
            var button = FindViewById <Button>(Resource.Id.MyButton);

            button.Click += (sender, args) =>
            {
                var left  = int.Parse(FindViewById <EditText>(Resource.Id.left).Text);
                var right = int.Parse(FindViewById <EditText>(Resource.Id.right).Text);
                FindViewById <TextView>(Resource.Id.result).Text = CLib.Add(left, right)
                                                                   .ToString(CultureInfo.InvariantCulture);
            };
        }