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

            var color = UIColor.FromRGB(64, 64, 64);

            View.BackgroundColor = color;
            ButtonBack.SetImage(UIImage.FromBundle("arrow_left").ImageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal), UIControlState.Normal);

            ViewTop.BackgroundColor = UIColor.Clear;
            //ViewTop.Layer.MasksToBounds = false;
            //ViewTop.Layer.ShadowOpacity = 1f;
            //ViewTop.Layer.ShadowOffset = new CGSize(0, 2);
            //ViewTop.Layer.ShadowColor = UIColor.Gray.CGColor;
            //ViewTop.Layer.CornerRadius = 0;

            ButtonSpinner.BackgroundColor = UIColor.Clear;
            ButtonSpinner.Font            = UIFont.SystemFontOfSize(13);
            ButtonSpinner.SetTitle("Select album", UIControlState.Normal);
            ButtonSpinner.Layer.CornerRadius = 3;
            ButtonSpinner.Layer.BorderColor  = UIColor.White.CGColor;
            ButtonSpinner.Layer.BorderWidth  = 1f;

            galleryCollectionSource = new GalleryCollectionSource(assets, this);

            CollectionGallery.RegisterNibForCell(UINib.FromName("GalleryItemPhotoViewCell", NSBundle.MainBundle), "GalleryItemPhotoViewCell");
            CollectionGallery.DataSource = galleryCollectionSource;
            CollectionGallery.SetCollectionViewLayout(GetLayoutWhenOrientaion(), true);

            ViewBottom.BackgroundColor       = color.ColorWithAlpha(0.7f);
            ButtonDone.Layer.BackgroundColor = UIColor.FromRGB(42, 131, 193).CGColor;
            ButtonDone.Layer.CornerRadius    = 12;
            ButtonDone.SetTitle("Done", UIControlState.Normal);

            ButtonBack.TouchUpInside += (object sender, EventArgs e) =>
            {
                OnPicked?.Invoke(new List <PhotoSetNative>());
                //DismissViewController(true, null);
            };

            ButtonDone.TouchUpInside += (object sender, EventArgs e) =>
            {
                OnPicked?.Invoke(GetCurrentSelected());
                //MessagingCenter.Send<SupportGalleryPickerController, List<PhotoSetNative>>(this, Utils.SubscribeImageFromGallery, GetCurrentSelected());
                //DismissModalViewController(true);
            };

            ButtonSpinner.TouchUpInside += (sender, e) => {
                ShowData();
            };

            InitShowDialog();
            FeetchAddPhotos();
        }
 public override void ViewDidLayoutSubviews()
 {
     base.ViewDidLayoutSubviews();
     try
     {
         CollectionGallery.SetCollectionViewLayout(GetLayoutWhenOrientaion(), true);
     }
     catch (Exception ex)
     {
         Debug.WriteLine(ex.StackTrace);
     }
 }