Changed to focus at option button after pin/unpin
authorjjie.choi <jjie.choi@samsung.com>
Wed, 24 May 2017 08:36:06 +0000 (17:36 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:56 +0000 (18:34 +0900)
Change-Id: Id84aeafbde1fa4b97bff2fcf0f27927c5036829e
Signed-off-by: jjie.choi <jjie.choi@samsung.com>
TVApps/TVApps/ViewModels/MainPageViewModel.cs
TVApps/TVApps/Views/FooterNormalStatus.xaml
TVApps/TVApps/Views/FooterNormalStatus.xaml.cs

index 7efefd9..626a8b2 100755 (executable)
@@ -126,6 +126,12 @@ namespace TVApps.ViewModels
             }
         }
 
+        public bool SetFocusOptionButton
+        {
+            get;
+            set;
+        }
+
         /// <summary>
         /// A command will be executed if the cancel button in FooterDeleteStatus is clicked
         /// </summary>
@@ -290,6 +296,9 @@ namespace TVApps.ViewModels
                     AppControlUtils.SendAppAddedNotificationToHome("org.tizen.settings");
                     AppControlUtils.SelfTerminate();
                 }
+                SetFocusOptionButton = true;
+                OnPropertyChanged("SetFocusOptionButton");
+
             });
 
             SortOptionIndexCommand = new Command<int>((sortingOption) =>
index 849808c..4d65a2f 100644 (file)
@@ -5,6 +5,7 @@
       x:Class="TVApps.Views.FooterNormalStatus"
       PinAppCommand="{Binding ButtonPinAppCommand}"
       DeleteAppCommand="{Binding ButtonDeleteAppCommand}"
-      SortOptionIndexCommand="{Binding SortOptionIndexCommand}">
+      SortOptionIndexCommand="{Binding SortOptionIndexCommand}"
+      SetFocusOptionButton ="{Binding SetFocusOptionButton}">
 
 </RelativeLayout>
\ No newline at end of file
index da65aaa..733e38a 100755 (executable)
@@ -64,6 +64,13 @@ namespace TVApps.Views
             set { SetValue(SortOptionIndexCommandProperty, value); }
         }
 
+        public static readonly BindableProperty SetFocusOptionButtonProperty = BindableProperty.Create("SetFocusOptionButton", typeof(bool), typeof(FooterNormalStatus), false, BindingMode.TwoWay);
+        public bool SetFocusOptionButton
+        {
+            get { return (bool)GetValue(SetFocusOptionButtonProperty); }
+            set { SetValue(SetFocusOptionButtonProperty, value); }
+        }
+
         /// <summary>
         /// A command will be executed if the Context Popup is showed or dismissed
         /// </summary>
@@ -78,6 +85,8 @@ namespace TVApps.Views
 
             CreateSortButton();
             CreateOptionButton();
+
+            PropertyChanged += FooterNormalStatusPropertyChanged;
         }
 
         /// <summary>
@@ -191,5 +200,18 @@ namespace TVApps.Views
             isPopupShowing = true;
             ChangeBackKeyInfoCommand?.Execute(isPopupShowing);
         }
+
+
+        private void FooterNormalStatusPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
+        {
+            if (e.PropertyName.Equals("SetFocusOptionButton"))
+            {
+                if (SetFocusOptionButton)
+                {
+                    OptionButton.Focus();
+                    SetFocusOptionButton = false;
+                }
+            }
+        }
     }
 }