Exemple #1
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            Title = "Ball Control";

            var source = new MvxActionBasedBindableTableViewSource(
                TableView,
                UITableViewCellStyle.Subtitle,
                new NSString("SpheroBalls"),
                "{'TitleText':{'Path':'Name'}}",
                UITableViewCellAccessory.DisclosureIndicator);

            source.CellModifier = (cell) =>
            {
                cell.Image.DefaultImagePath = "Images/SpheroIcon100.png";
            };
            source.SelectionChanged += (sender, args) => {
                ViewModel.GoToSpheroCommand.Execute(args.AddedItems[0]);
            };
            this.AddBindings(
                new Dictionary <object, string>()
            {
                { source, "{'ItemsSource':{'Path':'ListService.AvailableSpheros'}}" }
            });

            TableView.Source = source;
            TableView.ReloadData();

            var button = new UIBarButtonItem(UIBarButtonSystemItem.Add, (sender, e) => {
                ViewModel.RefreshListCommand.Execute(null);
            });

            NavigationItem.SetRightBarButtonItem(button, false);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

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

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

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

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

            source.CellCreator = (tableView, indexPath, item) =>
            {
                return(TeamCell.LoadFromNib(tableView));
            };
            this.AddBindings(new Dictionary <object, string>()
            {
                { source, "{'ItemsSource':{'Path':'Team'}}" },
            });
            TableView.RowHeight       = 125;
            TableView.Source          = source;
            TableView.BackgroundColor = UIColor.White;
            TableView.ReloadData();
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

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

            var source = new MvxActionBasedBindableTableViewSource(
                TableView,
                UITableViewCellStyle.Subtitle,
                new NSString("Twitter"),
                CellBindingText,
                UITableViewCellAccessory.None);

            source.CellModifier = (cell) =>
            {
                cell.Image.DefaultImagePath = "Images/Icons/50_icon.png";
            };

            this.AddBindings(new Dictionary <object, string>()
            {
                { source, "{'ItemsSource':{'Path':'Tweets'}}" },
                { _activityView, "{'Hidden':{'Path':'IsSearching','Converter':'InvertedVisibility'}}" },
            });
            TableView.Source = source;
            TableView.ReloadData();
        }
Exemple #4
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var source = new MvxActionBasedBindableTableViewSource(
                TableView,
                UITableViewCellStyle.Subtitle,
                new NSString("BookListView"),
                "{'TitleText':{'Path':'Title'},'DetailText':{'Path':'Author'},'SelectedCommand':{'Path':'ViewDetailCommand'},'HttpImageUrl':{'Path':'AmazonImageUrl'}}",
                UITableViewCellAccessory.DisclosureIndicator);

            source.CellModifier = (cell) =>
            {
                cell.Image.DefaultImagePath = "icon.png";
            };

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

            TableView.Source = source;
            TableView.ReloadData();
        }
Exemple #5
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

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

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

            _tableView = new FoldingTableViewController(new System.Drawing.RectangleF(0, 0, 320, 367), UITableViewStyle.Plain);
            var source = new MvxActionBasedBindableTableViewSource(
                _tableView.TableView,
                UITableViewCellStyle.Default,
                TweetCell.Identifier,
                TweetCell.CellBindingText,
                UITableViewCellAccessory.None);

            source.CellModifier = (cell) =>
            {
                cell.Image.DefaultImagePath = "Images/Icons/50_icon.png";
            };
            source.CellCreator = (tableView, indexPath, item) =>
            {
                return(TweetCell3.LoadFromNib(_tableView));
            };
            this.AddBindings(new Dictionary <object, string>()
            {
                { source, "{'ItemsSource':{'Path':'TweetsPlus'}}" },
                //{_activityView, "{'Hidden':{'Path':'IsSearching','Converter':'InvertedVisibility'}}"},
                { _tableView, "{'Refreshing':{'Path':'IsSearching'},'RefreshHeadCommand':{'Path':'RefreshCommand'},'LastUpdatedText':{'Path':'WhenLastUpdatedUtc','Converter':'SimpleDate'}}" },
            });

            _tableView.TableView.RowHeight = 100;
            _tableView.TableView.Source    = source;
            _tableView.TableView.ReloadData();
            this.Add(_tableView.View);


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