Esempio n. 1
0
 private void UncheckSelectedImages(object sender, EventArgs e)
 {
     foreach (var indexPath in GalleryDataSource.SelectedImageIndexPaths)
     {
         var galleryImageCell = (GalleryImageCell)GalleryCollectionView.DequeueReusableCell(GalleryImageCell.Key, indexPath);
         galleryImageCell.SetGalleryCheckmark();
     }
     GalleryCollectionView.ReloadData();
     ClearSelectedImages();
     ResetGalleryTitle();
     ToggleToolBarVisibility(false);
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            source = new GalleryCollectionViewSource(PostImageView);
            source.LoadData(dataContext.GaleryImagePaths);

            SetBindings();
            SetCommands();
            BaseStyling();
            EventStyling();

            NavigationBar.Set(this, HomeButton, FriendsButton, AddPostButton, ProfileButton);

            GalleryCollectionView.RegisterNibForCell(GalleryCollectionViewCell.Nib, GalleryCollectionViewCell.Key);

            var layout = new UICollectionViewFlowLayout
            {
                ItemSize = new CoreGraphics.CGSize(90, 90)
            };

            GalleryCollectionView.SetCollectionViewLayout(layout, true);

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

            source.OnImageSelect += (o, e) =>
            {
                if (GalleryCollectionViewSource.SelectedImagePath != null)
                {
                    dataContext.SelectedImagePath = GalleryCollectionViewSource.SelectedImagePath;
                    GalleryCollectionViewSource.SelectedImagePath = null;
                }
            };

            CreatePostButton.TouchUpInside += (o, e) =>
            {
                Navigator.Navigate(this, CtrConst.FeedController);
            };
        }
Esempio n. 3
0
 public override void ViewWillAppear(bool animated)
 {
     GalleryDataSource.LoadImages();
     GalleryCollectionView.ReloadData();
 }