Ejemplo n.º 1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();
            // Perform any additional setup after loading the view, typically from a nib.

            var source = new AnswerTableSource (SelectedVote.Answers, SelectedVote.SelectType == AnswerType.Single );

            voteTable.Source = source;
            voteTable.AllowsSelection = false;

            var builder = new StringBuilder ();

            source.AnswerSelected += (sender, e) => {

                builder.Clear ();

                var list = source.SelectedIndex.Keys.ToList ();
                list.ForEach (i => builder.AppendFormat (@"{0},", i));

            };

            btnConfirm.TouchUpInside += (sender, e) => {

                var list = source.SelectedIndex.Keys.ToList ();

                foreach (var answer in SelectedVote.Answers) {

                    foreach (int i in list) {

                        if (i == answer.Id) {
                            answer.Count++;
                        }

                    }
                }

                PerformSegue ("moveToResultSegue", this );
            };
        }
Ejemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            var source = new AnswerTableSource(SelectedVote.Answers, SelectedVote.SelectType == AnswerType.Single);

            voteTable.Source          = source;
            voteTable.AllowsSelection = false;

            var builder = new StringBuilder();

            source.AnswerSelected += (sender, e) => {
                builder.Clear();

                var list = source.SelectedIndex.Keys.ToList();
                list.ForEach(i => builder.AppendFormat(@"{0},", i));
            };

            btnConfirm.TouchUpInside += (sender, e) => {
                var list = source.SelectedIndex.Keys.ToList();

                foreach (var answer in SelectedVote.Answers)
                {
                    foreach (int i in list)
                    {
                        if (i == answer.Id)
                        {
                            answer.Count++;
                        }
                    }
                }

                PerformSegue("moveToResultSegue", this);
            };
        }