Esempio n. 1
0
        public override void ViewDidLoad()
        {
            _viewDidLoad = true;
            base.ViewDidLoad();
            MyViewModel.Factory = App.SGFactory;
            MyViewModel.MyView  = this;

            //CollectionView.RegisterClassForCell(typeof(BaseViewCell), BaseViewCell.Key);
            CollectionView.RegisterNibForCell(BaseViewCell.Nib, BaseViewCell.Key);
            var source = new MvxCollectionViewSource(CollectionView, BaseViewCell.Key);

            CollectionView.Source = source;

            var set = this.CreateBindingSet <BarCell3, BarViewModel>();

            set.Bind(source).To(vm => vm.Views);
            set.Apply();

            //CollectionView.CollectionViewLayout = new UICollectionViewFlowLayout
            //                                          {
            //                                              ItemSize = new SizeF(320, 400),
            //                                              ScrollDirection = UICollectionViewScrollDirection.Horizontal,
            //                                          };

            CollectionView.ReloadData();

            //CollectionView.RegisterClassForCell(typeof(BaseViewCell), BaseViewCell.Key);
        }
Esempio n. 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            // Perform any additional setup after loading the view, typically from a nib.

            var collectionSource = new MvxCollectionViewSource(collectionView, FirstCell.Key);

            collectionView.RegisterNibForCell(FirstCell.Nib, FirstCell.Key);
            collectionView.Source = collectionSource;

            var tableSource = new MvxSimpleTableViewSource(tableView, TableViewCell.Key, TableViewCell.Key);

            tableView.RegisterNibForCellReuse(TableViewCell.Nib, TableViewCell.Key);
            tableView.Source          = tableSource;
            tableView.AllowsSelection = false;

            //binding
            var set = this.CreateBindingSet <FirstView, FirstViewModel>();

            set.Bind(collectionSource).To(vm => vm.AllNumbers);
            set.Bind(tableSource).To(vm => vm.AllGroups);
            set.Apply();

            collectionView.ReloadData();
            tableView.ReloadData();
        }
Esempio n. 3
0
        public override void ViewDidLoad()
        {
            if (!_isInitialised)
            {
                return;
            }

            base.ViewDidLoad();

            // Perform any additional setup after loading the view, typically from a nib.
            //var source = new TableSource(TableView);

            //this.CreateBinding(source).To((BarHolderViewModel vm) => vm.Bars).Apply();

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

            CollectionView.RegisterNibForCell(BarCell.Nib, BarCell.Key);
            var source = new MvxCollectionViewSource(CollectionView, BarCell.Key);

            CollectionView.Source = source;

            var set = this.CreateBindingSet <TestView, BarHolderViewModel>();

            set.Bind(source).To(vm => vm.Bars);
            set.Apply();

            CollectionView.ReloadData();
            VerticalCollectionView = CollectionView;

            ViewModel.PropertyChanged += HandleViewModelPropertyChanged;
        }
Esempio n. 4
0
    protected override void ViewDidLoad()
    {
        base.ViewDidLoad();

        var bindingSet = this.CreateBindingSet <CollectionView, CollectionViewModel>();

        var source = new MvxCollectionViewSource(List);

        List.Source = source;
        bindingSet.Bind(source).To(vm => vm.List);
        bindingSet.Bind(source).For(s => s.SelectedItem).To(vm => vm.Current);
        //bindingSet.Bind(source).For("SelectedItemChanged").To(vm => vm.ShowItemCommand).CommandParameter("Hello");
        bindingSet.Bind(source).For("SelectionChangedCommand").To(vm => vm.SelectionChangedCommand);

        bindingSet.Bind(AddButton).To(vm => vm.AddCommand);
        bindingSet.Bind(RemoveButton).To(vm => vm.RemoveCommand);
        bindingSet.Bind(ReplaceButton).To(vm => vm.ReplaceCommand);
        bindingSet.Bind(MoveButton).To(vm => vm.MoveCommand);
        bindingSet.Bind(ReloadButton).To(vm => vm.ReloadCommand);

        bindingSet.Bind(CloseButton).To(vm => vm.CloseCommand);

        bindingSet.Apply();

        //Property SelectedItem with XXXChanged will auto bind to SelectionChangedCommand
    }
Esempio n. 5
0
        public sealed override void ViewDidLoad()
        {
            if (!_isInitialised)
            {
                return;
            }

            base.ViewDidLoad();

            CollectionView.RegisterNibForCell(BarCell.Nib, BarCell.Key);
            var source = new MvxCollectionViewSource(CollectionView, BarCell.Key);

            CollectionView.Source = source;

            ViewModel.Factory = App.SGFactory;
            ViewModel.Initialize();

            var set = this.CreateBindingSet <FirstView, BarHolderViewModel>();

            set.Bind(source).To(vm => vm.Bars);
            set.Apply();

            CollectionView.ReloadData();

            //SGFactory.Request = this.Request;
        }
Esempio n. 6
0
        public sealed override void ViewDidLoad()
        {
            if (!_isInitialised)
            {
                return;
            }

            base.ViewDidLoad();

            // ios7 layout
            if (RespondsToSelector(new Selector("edgesForExtendedLayout")))
            {
                EdgesForExtendedLayout = UIRectEdge.None;
            }

            CollectionView.RegisterNibForCell(KittenCollectionCell.Nib, KittenCollectionCell.Key);
            var source = new MvxCollectionViewSource(CollectionView, KittenCollectionCell.Key);

            CollectionView.Source = source;

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

            set.Bind(source).To(vm => vm.Kittens);
            set.Apply();

            CollectionView.ReloadData();
        }
Esempio n. 7
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Register any custom UICollectionViewCell classes
            //CollectionView.RegisterClassForCell (typeof(FirstCollectionViewCell), FirstCollectionViewCell.Key);


            CollectionView.RegisterNibForCell(BarCell.Nib, BarCell.Key);
            var source = new MvxCollectionViewSource(CollectionView, BarCell.Key);

            CollectionView.Source = source;

            var set = this.CreateBindingSet <FirstCollectionViewController, BarHolderViewModel>();

            set.Bind(source).To(vm => vm.Bars);
            set.Apply();

            CollectionView.ReloadData();

            // Note: If you use one of the Collection View Cell templates to create a new cell type,
            // you can register it using the RegisterNibForCell() method like this:
            //
            // CollectionView.RegisterNibForCell (MyCollectionViewCell.Nib, MyCollectionViewCell.Key);
        }
Esempio n. 8
0
        protected virtual void BindBottomCollection(UICollectionView bottomCollection, MvxFluentBindingDescriptionSet <SSCategoriesViewController, ISSCategoriesViewModel> set)
        {
            var bottomDataSource = new MvxCollectionViewSource(bottomCollection, BannerCell.Key);

            set.Bind(bottomDataSource).To(vm => vm.BottomBanners);
            set.Bind(bottomDataSource).For(ds => ds.SelectionChangedCommand).To(vm => vm.BannerSelectionChangedCommand);

            bottomCollection.Source = bottomDataSource;
            bottomCollection.ReloadData();
        }
Esempio n. 9
0
        private void SetupCollectionView()
        {
            _source = new AddPostCollectionSource(ImageCollection, SelectedImageCell.Identifier, new WeakReference <AddPostView>(this));
            ImageCollection.RegisterClassForCell(typeof(SelectedImageCell), SelectedImageCell.Identifier);

            var collectionLayout = new SpacingCollectionFlowLayout {
                ItemSize = new CGSize(100, 110),
            };

            ImageCollection.CollectionViewLayout = collectionLayout;
            ImageCollection.Source = _source;
        }
Esempio n. 10
0
        private void SetupSubViews()
        {
            SelectionStyle = UITableViewCellSelectionStyle.None;

            BackgroundColor = iOS.Appearance.Colors.BackgroundColor;

            _backPanelView = new BackPanelView {
                BackgroundColor = iOS.Appearance.Colors.White
            };

            _logo = new MvxImageView();
            _logo.Layer.CornerRadius = 12.0f;
            _logo.Layer.BorderWidth  = 1;
            _logo.Layer.BorderColor  = iOS.Appearance.Colors.RulerColor.CGColor;
            _logo.ClipsToBounds      = true;

            _name = new UILabel {
                Font = iOS.Appearance.Fonts.LatoBoldWithSize(16), TextColor = iOS.Appearance.Colors.DefaultTextColor
            };

            _industry = new UILabel {
                Font = iOS.Appearance.Fonts.LatoWithSize(13), TextColor = iOS.Appearance.Colors.DefaultTextColor
            };

            _horizontalLine = new UIView {
                BackgroundColor = iOS.Appearance.Colors.RulerColor
            };

            _numberOfCoworkers = new UILabel {
                Font = iOS.Appearance.Fonts.LatoWithSize(12), TextColor = iOS.Appearance.Colors.SubTextColor
            };

            _usersCollection = new UICollectionView(ContentView.Frame, new UICollectionViewFlowLayout {
                ItemSize = new CGSize(20, 20), ScrollDirection = UICollectionViewScrollDirection.Horizontal, MinimumInteritemSpacing = 0, MinimumLineSpacing = 2
            })
            {
                AllowsSelection = true,
                ScrollEnabled   = false,
                BackgroundColor = UIColor.Clear,
            };

            _usersCollection.RegisterClassForCell(typeof(CollectionUserCell), CollectionUserCell.Identifier);
            _usersCollection.Source = _source = new MvxCollectionViewSource(_usersCollection, CollectionUserCell.Identifier);

            ContentView.Add(_backPanelView);
            ContentView.Add(_horizontalLine);
            ContentView.Add(_logo);
            ContentView.Add(_name);
            ContentView.Add(_industry);
            ContentView.Add(_numberOfCoworkers);
            ContentView.Add(_usersCollection);
        }
Esempio n. 11
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            Title = "Recipes";

            collectionViewSource  = new MvxCollectionViewSource(collectionView, new NSString("CollectionViewCell"));
            collectionView.Source = collectionViewSource;

            var set = this.CreateBindingSet <HomeView, HomeViewModel>();

            set.Bind(collectionViewSource).To(vm => vm.Recipes);
            set.Bind(collectionViewSource).For(src => src.SelectionChangedCommand).To(vm => vm.ShowRecipeDetailCommand);
            set.Apply();
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            CollectionPersons.RegisterNibForCell(CollectionViewCell.Nib, CollectionViewCell.Key);
            var sourse = new MvxCollectionViewSource(CollectionPersons, CollectionViewCell.Key);

            CollectionPersons.Source   = sourse;
            CollectionPersons.Delegate = new ListDelegateFlowLayout();
            var set = this.CreateBindingSet <CollectionViewController, ListViewModel>();

            set.Bind(sourse).For(s => s.ItemsSource).To(vm => vm.Persons);
            set.Apply();
        }
Esempio n. 13
0
        protected TableViewCell(IntPtr handle) : base(handle)
        {
            // Note: this .ctor should not contain any initialization logic.
            this.DelayBind(() => {
                var set                    = this.CreateBindingSet <TableViewCell, NumberGroupViewModel>();
                var groupSource            = new MvxCollectionViewSource(groupCollectionView, FirstCell.Key);
                groupCollectionView.Source = groupSource;
                groupCollectionView.RegisterNibForCell(FirstCell.Nib, FirstCell.Key);

                set.Bind(groupSource).To(vm => vm.NumberVms);
                set.Bind(groupLabel).To(vm => vm.GroupKey);
                set.Apply();
            });
        }
Esempio n. 14
0
        public sealed override void ViewDidLoad()
        {
            if (!_isInitialised)
            {
                return;
            }

            base.ViewDidLoad();

            CollectionView.RegisterNibForCell(KittenCollectionCell.Nib, KittenCollectionCell.Key);
            var source = new MvxCollectionViewSource(CollectionView, KittenCollectionCell.Key);

            CollectionView.Source = source;

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

            set.Bind(source).To(vm => vm.Kittens);
            set.Apply();

            CollectionView.ReloadData();
        }
Esempio n. 15
0
        public sealed override void ViewDidLoad()
        {
            if (!_isInitialized)
            {
                return;
            }

            base.ViewDidLoad();

            CollectionView.RegisterNibForCell(ImageCollectionCell.Nib, ImageCollectionCell.Key);
            var source = new MvxCollectionViewSource(CollectionView, ImageCollectionCell.Key);

            CollectionView.Source = source;

            var set = this.CreateBindingSet <MainView, MainViewModel>();

            set.Bind(source).For(s => s.SelectionChangedCommand).To(vm => vm.ImageChooseCommand);
            set.Bind(source).To(vm => vm.Images);
            set.Apply();

            CollectionView.ReloadData();
        }
        private void OnBindContent()
        {
            var dataSource = new MvxCollectionViewSource(_collectionView, BannerCell.Key);

            var set = this.CreateBindingSet <BannersSupplementaryView, IDCategoriesViewModel>();

            if (ReuseIdentifier == ReuseIdentifierString_Header)
            {
                set.Bind(dataSource).To(vm => vm.TopBanners);
            }
            else if (ReuseIdentifier == ReuseIdentifierString_Footer)
            {
                set.Bind(dataSource).To(vm => vm.BottomBanners);
            }

            set.Bind(dataSource).For(ds => ds.SelectionChangedCommand).To(vm => vm.BannerSelectionChangedCommand);

            set.Apply();

            _collectionView.Source = dataSource;
            _collectionView.ReloadData();
        }
Esempio n. 17
0
        private void SetupSubViews()
        {
            BackgroundColor = iOS.Appearance.Colors.BackgroundColor;

            // Header
            _header = new UIImageView
            {
                BackgroundColor = UIColor.Black,
                ContentMode     = UIViewContentMode.ScaleAspectFill,
                ClipsToBounds   = true
            };

            _date = new UILabel
            {
                TextColor     = iOS.Appearance.Colors.DefaultTextColor,
                Font          = iOS.Appearance.Fonts.LatoWithSize(13),
                TextAlignment = UITextAlignment.Center
            };
            _dateBackPanel = new UIView {
                BackgroundColor = iOS.Appearance.Colors.White
            };
            _dateBackPanel.Layer.CornerRadius = 4.0f;

            _infoContainer            = new UIView();
            _infoContainerPlaceHolder = new UIView();

            _title = new UILabel
            {
                TextColor     = iOS.Appearance.Colors.White,
                Font          = iOS.Appearance.Fonts.LatoBlackWithSize(24),
                Lines         = 2,
                LineBreakMode = UILineBreakMode.TailTruncation
            };
            _time = new UILabel {
                TextColor = iOS.Appearance.Colors.White, Font = iOS.Appearance.Fonts.LatoWithSize(15)
            };
            _location = new UILabel
            {
                TextColor     = iOS.Appearance.Colors.White,
                Font          = iOS.Appearance.Fonts.LatoWithSize(15),
                Lines         = 1,
                LineBreakMode = UILineBreakMode.TailTruncation
            };

            _attendButton = new BlueButton {
                Font = iOS.Appearance.Fonts.LatoBlackWithSize(18)
            };
            _attendButton.Layer.ShadowColor   = UIColor.Black.CGColor;
            _attendButton.Layer.ShadowRadius  = 10f;
            _attendButton.Layer.ShadowOpacity = 0.65f;
            _attendButton.Layer.ShadowOffset  = new CGSize(0, 5);

            _infoBackGround = new UIView {
                BackgroundColor = iOS.Appearance.Colors.White
            };

            _attendingLabel = new UILabel
            {
                Font      = iOS.Appearance.Fonts.LatoWithSize(15),
                TextColor = iOS.Appearance.Colors.SubTextColor
            };
            _attendingCollection = new UICollectionView(ContentView.Frame,
                                                        new UICollectionViewFlowLayout
            {
                ItemSize                = new CGSize(31, 31),
                ScrollDirection         = UICollectionViewScrollDirection.Horizontal,
                MinimumInteritemSpacing = 0,
                MinimumLineSpacing      = 5
            })
            {
                AllowsSelection = false,
                ScrollEnabled   = false,
                BackgroundColor = UIColor.Clear,
            };

            _attendingCollection.RegisterClassForCell(typeof(CollectionUserCell), CollectionUserCell.Identifier);
            _attendingCollection.Source    =
                _attendingCollectionSource =
                    new MvxCollectionViewSource(_attendingCollection, CollectionUserCell.Identifier);

            _ruler = new UIView {
                BackgroundColor = iOS.Appearance.Colors.RulerColor
            };

            _eventInfoHeader = new UILabel
            {
                Font      = iOS.Appearance.Fonts.LatoWithSize(15),
                TextColor = iOS.Appearance.Colors.SubTextColor,
            };
            _eventDateLabel = new UILabel
            {
                TextColor = iOS.Appearance.Colors.DefaultTextColor,
                Font      = iOS.Appearance.Fonts.LatoBoldWithSize(14),
            };
            _eventDate = new UILabel
            {
                TextColor = iOS.Appearance.Colors.ChatMessageColor,
                Font      = iOS.Appearance.Fonts.LatoWithSize(14)
            };
            _eventTimeLabel = new UILabel
            {
                TextColor = iOS.Appearance.Colors.DefaultTextColor,
                Font      = iOS.Appearance.Fonts.LatoBoldWithSize(14),
            };
            _eventTime = new UILabel
            {
                TextColor = iOS.Appearance.Colors.ChatMessageColor,
                Font      = iOS.Appearance.Fonts.LatoWithSize(14)
            };
            _eventLocationLabel = new UILabel
            {
                TextColor = iOS.Appearance.Colors.DefaultTextColor,
                Font      = iOS.Appearance.Fonts.LatoBoldWithSize(14),
            };
            EventLocation = new UILabel
            {
                TextColor = iOS.Appearance.Colors.ChatMessageColor,
                Font      = iOS.Appearance.Fonts.LatoWithSize(14),
                Lines     = 0,
            };

            _infoBottomBorder = new UIView {
                BackgroundColor = iOS.Appearance.Colors.RulerColor
            };

            _imageTopBorder = new UIView {
                BackgroundColor = iOS.Appearance.Colors.RulerColor
            };
            _imageBackground = new UIView {
                BackgroundColor = iOS.Appearance.Colors.White
            };
            _imageBottomBorder = new UIView {
                BackgroundColor = iOS.Appearance.Colors.RulerColor
            };

            _imageCollection = new UICollectionView(ContentView.Frame,
                                                    new UICollectionViewFlowLayout
            {
                ItemSize                = new CGSize(105, 105),
                ScrollDirection         = UICollectionViewScrollDirection.Horizontal,
                MinimumInteritemSpacing = 0,
                MinimumLineSpacing      = 14
            })
            {
                AllowsSelection = true,
                ScrollEnabled   = true,
                BackgroundColor = UIColor.White,
                ShowsHorizontalScrollIndicator = false,
            };

            _imageCollection.RegisterClassForCell(typeof(ImageCollectionCell), ImageCollectionCell.Identifier);
            _imageCollection.Source = _imageCollectionSource = new GenericCollectionViewSource <IImage>(_imageCollection, ImageCollectionCell.Identifier)
            {
                ModifyCellFunc = (view, path, cell, item) =>
                {
                    var imageCollectionCell = cell as ImageCollectionCell;

                    if (imageCollectionCell != null)
                    {
                        imageCollectionCell.CornerRadius = 8f;
                    }
                }
            };

            _aboutBackground = new UIView {
                BackgroundColor = iOS.Appearance.Colors.White
            };
            _aboutTopBorder = new UIView {
                BackgroundColor = iOS.Appearance.Colors.RulerColor
            };
            _aboutRuler = new UIView {
                BackgroundColor = iOS.Appearance.Colors.RulerColor
            };

            _aboutHeaderLabel = new UILabel
            {
                Font      = iOS.Appearance.Fonts.LatoBoldWithSize(14),
                TextColor = iOS.Appearance.Colors.DefaultTextColor,
            };
            AboutText = new HtmlTextView();

            //_commentButton = new FeedButton { ImageTopSpacing = 3 };

            ContentView.AddSubviews(_header, _infoContainer, _infoContainerPlaceHolder, _title, _time, _location,
                                    _dateBackPanel, _date, _attendButton, _infoBackGround, _attendingLabel, _attendingCollection, _ruler,
                                    _eventInfoHeader, _eventDate, _eventDateLabel, _eventTime, _eventTimeLabel, _eventLocationLabel,
                                    EventLocation, _infoBottomBorder, _imageBackground, _imageCollection, _imageTopBorder,
                                    _imageBottomBorder,
                                    _aboutBackground, _aboutTopBorder, AboutText, _aboutHeaderLabel, _aboutRuler);//, _commentButton);
        }