diff --git a/PicView/PicGallery/ToggleGallery.cs b/PicView/PicGallery/ToggleGallery.cs index 66d068642..f1fc44b77 100644 --- a/PicView/PicGallery/ToggleGallery.cs +++ b/PicView/PicGallery/ToggleGallery.cs @@ -145,13 +145,15 @@ internal static void OpenFullscreenGallery() fake.grid.Children.Add(picGallery); } - picGallery.Opacity = 1; + fake.Show(); IsOpen = true; ScrollTo(); mainWindow.Focus(); + VisualStateManager.GoToElementState(picGallery, "Opacity", false); + #if DEBUG Trace.WriteLine(nameof(picGallery) + " IsOpen = " + IsOpen + " " + nameof(OpenFullscreenGallery)); #endif @@ -174,13 +176,16 @@ internal static void CloseContainedGallery() galleryShortcut.Visibility = Visibility.Visible; } - var da = new DoubleAnimation { Duration = TimeSpan.FromSeconds(.5) }; - - da.To = 0; - da.From = 1; + var da = new DoubleAnimation { + Duration = TimeSpan.FromSeconds(.5), + From = 1, + To = 0, + FillBehavior = FillBehavior.Stop + }; da.Completed += delegate { picGallery.Visibility = Visibility.Collapsed; + picGallery.Opacity = 1; }; picGallery.BeginAnimation(UIElement.OpacityProperty, da); diff --git a/PicView/PicView.csproj b/PicView/PicView.csproj index 80c541ca3..f3eb48b0e 100644 --- a/PicView/PicView.csproj +++ b/PicView/PicView.csproj @@ -92,10 +92,6 @@ - - True - - @@ -194,12 +190,13 @@ - 0.9.7.7 + 0.9.8.0 false - LICENSE.txt + Ruben Hyldgaard Negendahl https://github.com/Ruben2776/PicView https://github.com/Ruben2776/PicView + GPL-3.0