Ejemplo n.º 1
0
        private void PrepareTableViewSource()
        {
            _source = new MultiChoiceTableViewSource(_table, _bundle.CheckedItems);
            var asStrings = _bundle.Items.Select(x => x.Title).ToArray();

            _source.ItemsSource = asStrings;
            _table.Source       = _source;
        }
Ejemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            tableViewSource              = new MvxSimpleTableViewSource(TableView, nameof(SelfSizingViewCell), SelfSizingViewCell.Key);
            TableView.Source             = tableViewSource;
            TableView.RowHeight          = UITableView.AutomaticDimension;
            TableView.EstimatedRowHeight = 44.0f;

            DoBind();
        }
Ejemplo n.º 3
0
        public virtual MvxTableViewSource InitialiseSource(UITableView tableView)
        {
            if (_source != null)
            {
                throw new MvxException("You cannot create the source more than once");
            }

            _source                         = CreateSource(tableView);
            _source.ItemsSource             = this.ItemsSource;
            _source.SelectionChangedCommand = this.ItemClick;
            return(_source);
        }
Ejemplo n.º 4
0
        public virtual MvxTableViewSource InitializeSource(UITableView tableView)
        {
            if (this._source != null)
            {
                throw new MvxException("You cannot create the source more than once");
            }

            this._source = this.CreateSource(tableView);
            this._source.ItemsSource = this.ItemsSource;
            this._source.SelectionChangedCommand = this.ItemClick;
            return this._source;
        }
Ejemplo n.º 5
0
        protected override void InitView()
        {
            _notesSource = new MvxSimpleTableViewSource(TableView, nameof(NoteCell), NoteCell.Key)
            {
                UseAnimations = true
            };
            TableView.Source = _notesSource;

            _addButton    = new UIBarButtonItem(UIBarButtonSystemItem.Add);
            _deleteButton = new UIBarButtonItem("Delete", null);

            NavigationItem.SetRightBarButtonItems(new[] { _addButton, _deleteButton }, false);
        }
Ejemplo n.º 6
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            Source           = new MvxStandardTableViewSource(TableView, UITableViewCellStyle.Subtitle, new NSString("SimpleBindableTableViewCell"), "TitleText Title", UITableViewCellAccessory.None);
            TableView.Source = Source;

            var set = this.CreateBindingSet <ListFragmentView, ListFragmentViewModel>();

            set.Bind(Source).To(vm => vm.Items);
            set.Bind(Source).For(v => v.SelectionChangedCommand).To(vm => vm.RemoveItemCommand);
            set.Bind(DownButton).To(vm => vm.ReloadListCommand);
            set.Bind(DownButton).For("Title").To(vm => vm.ButtonTitle);
            set.Apply();
        }
Ejemplo n.º 7
0
        private void OnSegmentedControlIndexChanged(object sender, int index)
        {
            // Ensure the correct source is set (the podcast uses a list vs the music search
            // results which uses a list of content groups).
            if (index == 3)
            {
                if (_source is ContentTableViewSource || _source is null)
                {
                    _source          = new MediaListViewSource(TableView);
                    TableView.Source = _source;
                }
            }
            else
            {
                if (_source is MediaListViewSource || _source is null)
                {
                    _source          = new ContentTableViewSource(TableView);
                    TableView.Source = _source;
                }
            }

            var set = this.CreateBindingSet <SearchView, SearchViewModel>();

            set.Bind(_refreshControl).For(x => x.RefreshCommand).To(vm => vm.RefreshCommand);
            set.Bind(_refreshControl).For(x => x.IsRefreshing).To(vm => vm.IsLoading);
            set.Bind(this).For(x => x.Title).To(vm => vm.SearchText);

            switch (index)
            {
            case 0:
                set.Bind(_source).For(x => x.ItemsSource).To(vm => vm.TracksContent);
                break;

            case 1:
                set.Bind(_source).For(x => x.ItemsSource).To(vm => vm.PlaylistsContent);
                break;

            case 2:
                set.Bind(_source).For(x => x.ItemsSource).To(vm => vm.UsersContent);
                break;

            case 3:
                set.Bind(_source).For(x => x.ItemsSource).To(vm => vm.PodcastsContent);
                break;
            }

            set.Apply();
            TableView.ReloadData();
        }
Ejemplo n.º 8
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            this.tableComment.RowHeight          = UITableView.AutomaticDimension;
            this.tableComment.EstimatedRowHeight = 44;

            source = new MvxStandardTableViewSource(this.tableComment, CommentItemView.Key);
            tableComment.RegisterNibForCellReuse(UINib.FromName("CommentItemView", NSBundle.MainBundle), CommentItemView.Key);
            //source = new CommentSource(this.tableComment);

            this.AddBindings(new Dictionary <object, string>
            {
                { source, "ItemsSource CommentItemViews" }
            });
            this.tableComment.Source = source;
            this.tableComment.ReloadData();
        }
Ejemplo n.º 9
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var column = new MvxTableColumn();

            column.Identifier  = "First";
            column.BindingText = "Text Name";
            column.HeaderCell  = new NSCell("Example");
            _tableView.AddColumn(column);

            var source = new MvxTableViewSource(_tableView);

            _tableView.Source = source;

            var set = this.CreateBindingSet <FirstViewController, FirstViewModel> ();

            set.Bind(source).For(v => v.ItemsSource).To(vm => vm.Tests);
            set.Bind(source).For(v => v.SelectionChangedCommand).To(vm => vm.GotoTestCommand);
            set.Apply();
        }
Ejemplo n.º 10
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var tableView = new NSTableView(new RectangleF(10, 400, 300, 300).Upside());

            Add(tableView);

            var column = new MvxTableColumn();

            column.Identifier  = "First";
            column.BindingText = "Text .";
            column.HeaderCell  = new NSCell("Example");
            tableView.AddColumn(column);

            var source = new MvxTableViewSource(tableView);

            tableView.Source = source;

            var add = new NSButton();

            add.Title = "+";
            add.Frame = new RectangleF(10, 100, 140, 30).Upside();
            Add(add);

            var remove = new NSButton();

            remove.Title = "-";
            remove.Frame = new RectangleF(170, 100, 140, 30).Upside();
            Add(remove);

            var set = this.CreateBindingSet <ListView, ListViewModel>();

            set.Bind(source).For(v => v.ItemsSource).To(vm => vm.Items);
            set.Bind(add).To(vm => vm.AddCommand);
            set.Bind(remove).To(vm => vm.RemoveCommand);
            set.Apply();
        }
Ejemplo n.º 11
0
 protected override void InitView()
 {
     _notesSource = new MvxSimpleTableViewSource(TableView, nameof(NoteCell), NoteCell.Key) { UseAnimations = true };
     TableView.Source = _notesSource;
 }
Ejemplo n.º 12
0
        protected void InitView()
        {
            Source = new MvxSimpleTableViewSource(TableView, typeof(ZipCodeTableViewCell));

            TableView.Source = Source;
        }
Ejemplo n.º 13
0
        protected void InitView()
        {
            Source = new CitiesTableViewSource(TableView);

            TableView.Source = Source;
        }