Initialize the saved rotation if the image viewer is disappering
authorGeunsun, Lee <gs86.lee@samsung.com>
Tue, 25 Apr 2017 05:49:36 +0000 (14:49 +0900)
committerGeunsun, Lee <gs86.lee@samsung.com>
Tue, 25 Apr 2017 05:49:36 +0000 (14:49 +0900)
Change-Id: I75275150a919a85131995a03c0bb240eda3133fc

TVMediaHub/TVMediaHub.Tizen/ViewModels/ImageTabViewModel.cs
TVMediaHub/TVMediaHub.Tizen/Views/ImageViewer.xaml.cs

index 9284685..f14aba9 100755 (executable)
@@ -176,7 +176,18 @@ namespace TVMediaHub.Tizen.ViewModels
 
             SavedRotationCommand = new Command<double>((rotation) =>
             {
-                CurrentImage.SavedRotation = rotation;
+                if (rotation == Convert.ToDouble(-1))
+                {
+                    /// Initialize the saved rotation
+                    foreach (var item in ImageInfoList)
+                    {
+                        item.SavedRotation = 0;
+                    }
+                }
+                else
+                {
+                    CurrentImage.SavedRotation = rotation;
+                }
             });
 
             ChangeSortOptionCommand = new Command<string>((opt) =>
index 53f6e06..d27c2ae 100755 (executable)
@@ -405,7 +405,7 @@ namespace TVMediaHub.Tizen.Views
         {
             base.OnDisappearing();
 
-            SavedRotationCommand?.Execute(default(double));
+            SavedRotationCommand?.Execute(Convert.ToDouble(-1));
         }
     }
 }