Modifies a bug and remove unuse function
authorHyerim Kim <rimi.kim@samsung.com>
Sat, 15 Apr 2017 08:20:39 +0000 (17:20 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:52 +0000 (18:34 +0900)
 - When back button is pressed in move mode, revert ButtonViewList
 - remove SetDefaultAppList() in MainPageViewModel

Change-Id: I9b39d41f30605518567906f4a81febf3a8ea4163
Signed-off-by: Hyerim Kim <rimi.kim@samsung.com>
TVHome/TVHome/ViewModels/MainPageViewModel.cs
TVHome/TVHome/Views/SubPanel.xaml.cs

index b7ee6e37317f3f215a71ebc2cc0b2758c41476f7..2964edd5bcdfb2a23a55484058a8d3e60a098ecc 100755 (executable)
@@ -179,7 +179,6 @@ namespace TVHome.ViewModels
             MakeMainMenuItems();
             InitStatus();
             InitCommands();
-            SetDefaultAppList();
             MakeSettingsButtons();
 
             UpdateAppList(null, null);
@@ -344,15 +343,6 @@ namespace TVHome.ViewModels
             OnPropertyChanged("MainList");
         }
 
-        /// <summary>
-        /// Gets default AppList for displaying items and updates the list to Apps SubPanel
-        /// </summary>
-        private void SetDefaultAppList()
-        {
-            AppList = TVHomeImpl.GetInstance.AppShortcutControllerInstance.GetDefaultShortcuts();
-            OnPropertyChanged("AppList");
-        }
-
         /// <summary>
         /// Gets the AppList for displaying items and updates the list to Apps SubPanel
         /// </summary>
index a767bcd7ea2806d8a1fc6462d2dc8cb363012976..fa810a988299b2364ed877028cdb6ad3a3f90fbb 100755 (executable)
@@ -184,6 +184,10 @@ namespace TVHome.Views
             }
         }
 
+        /// <summary>
+        /// A method is called when apps subpanel is changed to move mode and change item's IsEnabled property.
+        /// </summary>
+        /// <param name="selectedBtn">A selected button view to move</param>
         private void ChangeIsEnabledProperty(View selectedBtn)
         {
             foreach (var item in PanelButtonStack.Children)
@@ -276,6 +280,9 @@ namespace TVHome.Views
             await this.FadeTo(0.99, 300);
         }
 
+        /// <summary>
+        /// A method is called when back button is pressed in move mode
+        /// </summary>
         public void ChangeToDefaultMode()
         {
             if (isMoveMode)
@@ -297,6 +304,12 @@ namespace TVHome.Views
 
                 OnMoveCommand.Execute(isMoveMode);
                 ChangeLayoutButtons(isMoveMode);
+
+                ButtonViewList.Clear();
+                foreach (var stackItem in PanelButtonStack.Children)
+                {
+                    ButtonViewList.Add(stackItem);
+                }
             }
         }