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 b7ee6e3..2964edd 100755 (executable)
@@ -179,7 +179,6 @@ namespace TVHome.ViewModels
             MakeMainMenuItems();
             InitStatus();
             InitCommands();
-            SetDefaultAppList();
             MakeSettingsButtons();
 
             UpdateAppList(null, null);
@@ -345,15 +344,6 @@ namespace TVHome.ViewModels
         }
 
         /// <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>
         /// <param name="sender">The source of event</param>
index a767bcd..fa810a9 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);
+                }
             }
         }