Exemplo n.º 1
0
        internal static void ChangeToHorizontalGallery()
        {
            Properties.Settings.Default.FullscreenGallery = false;
            GalleryLoad.LoadLayout();

            if (GetFakeWindow.grid.Children.Contains(GetPicGallery))
            {
                GetFakeWindow.grid.Children.Remove(GetPicGallery);
                GetMainWindow.ParentContainer.Children.Add(GetPicGallery);
            }

            GetFakeWindow.Hide();
        }
Exemplo n.º 2
0
        internal static async void OpenFullscreenGallery(bool startup = false)
        {
            if (Pics.Count < 1 && !startup)
            {
                return;
            }

            Properties.Settings.Default.FullscreenGallery = true;
            GalleryLoad.LoadLayout();

            if (GetFakeWindow == null)
            {
                GetFakeWindow = new FakeWindow();
                GetFakeWindow.grid.Children.Add(new Views.UserControls.Gallery.PicGalleryTopButtons
                {
                    Margin = new Thickness(1, 12, 0, 0),
                });
            }

            // Switch gallery container to the correct window
            if (GetMainWindow.ParentContainer.Children.Contains(GetPicGallery))
            {
                GetMainWindow.ParentContainer.Children.Remove(GetPicGallery);
                GetFakeWindow.grid.Children.Add(GetPicGallery);
            }
            else if (!GetFakeWindow.grid.Children.Contains(GetPicGallery))
            {
                GetFakeWindow.grid.Children.Add(GetPicGallery);
            }

            GetFakeWindow.Show();
            GalleryNavigation.ScrollTo();
            GetMainWindow.Focus();

            if (!FreshStartup)
            {
                ScaleImage.TryFitImage();
            }

            // Fix not showing up opacity bug..
            VisualStateManager.GoToElementState(GetPicGallery, "Opacity", false);
            VisualStateManager.GoToElementState(GetPicGallery.Container, "Opacity", false);
            GetPicGallery.Opacity = GetPicGallery.Container.Opacity = 1;

            if (GetPicGallery.Container.Children.Count == 0)
            {
                await GalleryLoad.Load().ConfigureAwait(false);
            }
        }
Exemplo n.º 3
0
        internal static async void OpenHorizontalGallery()
        {
            if (Pics.Count < 1)
            {
                return;
            }

            Properties.Settings.Default.FullscreenGallery = false;
            GalleryLoad.LoadLayout();

            AnimationHelper.Fade(GetPicGallery, TimeSpan.FromSeconds(.3), TimeSpan.Zero, 0, 1);

            GetClickArrowLeft.Visibility                      =
                GetClickArrowRight.Visibility                 =
                    Getx2.Visibility                          =
                        GetMinus.Visibility                   =
                            GetRestorebutton.Visibility       =
                                GetGalleryShortcut.Visibility = Visibility.Hidden;

            if (GetFakeWindow != null)
            {
                if (GetFakeWindow.grid.Children.Contains(GetPicGallery))
                {
                    GetFakeWindow.grid.Children.Remove(GetPicGallery);
                    GetMainWindow.ParentContainer.Children.Add(GetPicGallery);
                }
            }

            GalleryNavigation.SetSelected(FolderIndex, true);
            GalleryNavigation.ScrollTo();

            if (GetPicGallery.Container.Children.Count == 0)
            {
                await GalleryLoad.Load().ConfigureAwait(false);
            }
            // Fix weird bug when changing folder and one item remains
            // TODO investigate if selected gallery item does not get removed?
            else if (GetPicGallery.Container.Children.Count == 1 && Pics.Count > 1)
            {
                GetPicGallery.Container.Children.Clear();
                await GalleryLoad.Load().ConfigureAwait(false);
            }
        }
Exemplo n.º 4
0
        internal static void ChangeToFullscreenGallery()
        {
            Properties.Settings.Default.FullscreenGallery = true;
            GalleryLoad.LoadLayout();

            if (GetFakeWindow != null)
            {
                if (!GetFakeWindow.grid.Children.Contains(GetPicGallery))
                {
                    GetMainWindow.ParentContainer.Children.Remove(GetPicGallery);
                    GetFakeWindow.grid.Children.Add(GetPicGallery);
                }
            }
            else
            {
                GetMainWindow.ParentContainer.Children.Remove(GetPicGallery);
                GetFakeWindow = new FakeWindow();
                GetFakeWindow.grid.Children.Add(GetPicGallery);
            }

            GetFakeWindow.Show();
            GalleryNavigation.ScrollTo();
            GetMainWindow.Focus();
        }