Пример #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            NavigationItem.SetRightBarButtonItem(new UIBarButtonItem("Tweet", UIBarButtonItemStyle.Bordered, (sender, e) => ViewModel.DoShareGeneral()), false);

            //this.View.BackgroundColor = UIColor.Black;

            //_activityView = new UIActivityIndicatorView(this.View.Frame);
            //Add(_activityView);
            //View.BringSubviewToFront(_activityView);

            var source = new MvxActionBasedTableViewSource(
                TableView,
                UITableViewCellStyle.Default,
                SponsorCell.Identifier,
                SponsorCell.BindingText,
                UITableViewCellAccessory.None);

            source.CellCreator = (tableView, indexPath, item) =>
            {
                return(SponsorCell.LoadFromNib(tableView));
            };
            this.AddBindings(new Dictionary <object, string>()
            {
                { source, "ItemsSource Sponsors" },
            });
            TableView.RowHeight       = 90;
            TableView.Source          = source;
            TableView.BackgroundColor = UIColor.White;
            TableView.ReloadData();
        }
Пример #2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var source = new MvxActionBasedTableViewSource(
                TableView,
                UITableViewCellStyle.Subtitle,
                new NSString("BookListView"),
                "TitleText Title;DetailText Author;SelectedCommand ViewDetailCommand;ImageUrl AmazonImageUrl",
                UITableViewCellAccessory.DisclosureIndicator);

            source.CellModifier = (cell) =>
            {
                cell.ImageLoader.DefaultImagePath = "res:icon.png";
            };

            this.AddBindings(
                new Dictionary <object, string>()
            {
                { source, "ItemsSource List" }
            });

            TableView.Source = source;
            TableView.ReloadData();
        }
Пример #3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var source = new MvxActionBasedTableViewSource(
                TableView,
                UITableViewCellStyle.Subtitle,
                new NSString("BookListView"),
                "TitleText Title;DetailText Author;SelectedCommand ViewDetailCommand;ImageUrl AmazonImageUrl",
                UITableViewCellAccessory.DisclosureIndicator);

            source.CellModifier = (cell) =>
                                      {
                                          cell.ImageLoader.DefaultImagePath = "res:icon.png";
                                      };

            this.AddBindings(
                new Dictionary<object, string>()
                    {
                        { source, "ItemsSource List" }
                    });

            TableView.Source = source;
            TableView.ReloadData();
        }
Пример #4
0
        private void PrepareTableView()
        {
            _source = new MvxActionBasedTableViewSource(
                tableRatingList,
                UITableViewCellStyle.Default,
                BookRatingCell.Identifier,
                BookRatingCell.BindingText,
                UITableViewCellAccessory.None);

            _source.CellCreator = (tableView, indexPath, item) =>
            {
                var cell = BookRatingCell.LoadFromNib(tableView);
                cell.RemoveDelay();
                return(cell);
            };

            tableRatingList.Source = _source;
        }
Пример #5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            if (ViewModel.CanUserLeaveScreen())
            {
                NavigationItem.HidesBackButton = false;
            }
            else
            {
                NavigationItem.HidesBackButton = true;
            }

            View.BackgroundColor                 = UIColor.FromRGB(242, 242, 242);
            ratingTableView.BackgroundColor      = UIColor.Clear;
            ratingTableView.SeparatorColor       = UIColor.Clear;
            ratingTableView.SeparatorStyle       = UITableViewCellSeparatorStyle.None;
            ratingTableView.DelaysContentTouches = false;

            var btnSubmit = new FlatButton(new CGRect(8f, BottomPadding, 304f, 41f));

            FlatButtonStyle.Green.ApplyTo(btnSubmit);
            btnSubmit.SetTitle(Localize.GetValue("Submit"), UIControlState.Normal);

            ViewModel.PropertyChanged += async(sender, e) => {
                if (e.PropertyName == "CanRate")
                {
                    ShowDoneButton();
                }
            };

            var source = new MvxActionBasedTableViewSource(
                ratingTableView,
                UITableViewCellStyle.Default,
                BookRatingCell.Identifier,
                BookRatingCell.BindingText,
                UITableViewCellAccessory.None);

            source.CellCreator = (tableView, indexPath, item) =>
            {
                var cell = BookRatingCell.LoadFromNib(tableView);
                cell.RemoveDelay();
                return(cell);
            };
            ratingTableView.Source = source;

            var set = this.CreateBindingSet <BookRatingView, BookRatingViewModel>();

            set.Bind(btnSubmit)
            .For("TouchUpInside")
            .To(vm => vm.RateOrder);
            set.Bind(btnSubmit)
            .For(v => v.Hidden)
            .To(vm => vm.CanRate)
            .WithConversion("BoolInverter");

            set.Bind(source)
            .For(v => v.ItemsSource)
            .To(vm => vm.RatingList);

            set.Apply();
        }