Ejemplo n.º 1
0
        public static void ShowPhotosFromProfile(long userOrGroupId, bool isGroup, int selectedPhotoIndex, List <Photo> photos, bool canLoadMoreProfileListPhotos)
        {
            ImageViewerViewModel   imageViewerViewModel    = new ImageViewerViewModel(userOrGroupId, isGroup, photos, canLoadMoreProfileListPhotos, 0L);
            ImageViewerDecoratorUC decoratorForCurrentPage = ImageViewerDecoratorUC.GetDecoratorForCurrentPage(null);
            ImageViewerViewModel   ivvm = imageViewerViewModel;

            decoratorForCurrentPage.InitWith(ivvm, (Func <int, Image>)(i => null), null, null, null);
            int ind = selectedPhotoIndex;

            decoratorForCurrentPage.Show(ind);
        }
Ejemplo n.º 2
0
        public static void ShowPhotosFromAlbum(string aid, int albumType, long userOrGroupId, bool isGroup, int photosCount, int selectedPhotoIndex, List <Photo> photos, Func <int, Image> getImageByIdFunc)
        {
            ImageViewerViewModel   imageViewerViewModel    = new ImageViewerViewModel(aid, (AlbumType)albumType, userOrGroupId, isGroup, photosCount, photos);
            ImageViewerDecoratorUC decoratorForCurrentPage = ImageViewerDecoratorUC.GetDecoratorForCurrentPage(null);
            ImageViewerViewModel   ivvm = imageViewerViewModel;
            Func <int, Image>      getImageByIdFunc1 = getImageByIdFunc;

            decoratorForCurrentPage.InitWith(ivvm, getImageByIdFunc1, null, null, null);
            int ind = selectedPhotoIndex;

            decoratorForCurrentPage.Show(ind);
        }
Ejemplo n.º 3
0
        public static void ShowPhotosOrGifsById(int selectedPhotoIndex, List <PhotoOrDocument> photoOrDocList, bool fromDialog = false, bool friendsOnly = false, Func <int, Image> getImageByIdFunc = null, PageBase page = null, bool hideActions = false, FrameworkElement currentViewControl = null, Action <int> setContextOnCurrentViewControl = null, Action <int, bool> showHideOverlay = null, bool shareButtonOnly = false)
        {
            ImageViewerViewModel   ivvm = new ImageViewerViewModel(photoOrDocList);
            ImageViewerDecoratorUC decoratorForCurrentPage = ImageViewerDecoratorUC.GetDecoratorForCurrentPage(page);

            decoratorForCurrentPage.InitWith(ivvm, getImageByIdFunc, currentViewControl, setContextOnCurrentViewControl, showHideOverlay);
            decoratorForCurrentPage._fromDialog  = fromDialog;
            decoratorForCurrentPage._friendsOnly = friendsOnly;
            decoratorForCurrentPage._hideActions = hideActions;
            if (hideActions)
            {
                decoratorForCurrentPage.gridBottom.Visibility = Visibility.Collapsed;
            }
            decoratorForCurrentPage.Show(selectedPhotoIndex);
        }
Ejemplo n.º 4
0
        public static void ShowPhotosById(int photosCount, int initialOffset, int selectedPhotoIndex, List <long> photoIds, List <long> ownerIds, List <string> accessKeys, List <Photo> photos, bool fromDialog = false, bool friendsOnly = false, Func <int, Image> getImageByIdFunc = null, PageBase page = null, bool hideActions = false)
        {
            ViewerMode             mode = ViewerMode.PhotosByIds;
            ImageViewerViewModel   ivvm = new ImageViewerViewModel(photosCount, initialOffset, photoIds, ownerIds, accessKeys, photos, mode);
            ImageViewerDecoratorUC decoratorForCurrentPage = ImageViewerDecoratorUC.GetDecoratorForCurrentPage(page);

            decoratorForCurrentPage.InitWith(ivvm, getImageByIdFunc, null, null, null);
            decoratorForCurrentPage._fromDialog  = fromDialog;
            decoratorForCurrentPage._friendsOnly = friendsOnly;
            decoratorForCurrentPage._hideActions = hideActions;
            if (hideActions)
            {
                decoratorForCurrentPage.gridBottom.Visibility = Visibility.Collapsed;
            }
            decoratorForCurrentPage.Show(selectedPhotoIndex);
        }
Ejemplo n.º 5
0
        public static void ShowPhotosFromFeed(long userOrGroupId, bool isGroup, string aid, int photosCount, int selectedPhotoIndex, int date, List <Photo> photos, string mode, Func <int, Image> getImageByIdFunc)
        {
            ViewerMode             mode1 = (ViewerMode)Enum.Parse(typeof(ViewerMode), mode);
            ImageViewerViewModel   ivvm  = new ImageViewerViewModel(userOrGroupId, isGroup, aid, photosCount, date, photos, mode1);
            ImageViewerDecoratorUC dec   = ImageViewerDecoratorUC.GetDecoratorForCurrentPage(null);

            dec.InitWith(ivvm, getImageByIdFunc, null, null, null);
            ivvm.LoadPhotosFromFeed((Action <bool>)(res =>
            {
                if (!res)
                {
                    return;
                }
                Execute.ExecuteOnUIThread((Action)(() => dec.HandlePhotoUpdate(ivvm)));
            }));
            dec.Show(selectedPhotoIndex);
        }