From: jjie.choi Date: Mon, 22 May 2017 08:37:52 +0000 (+0900) Subject: Show toast when the number of selected apps exceeds 10 X-Git-Tag: submit/tizen/20170808.015446~26 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b71b53d118df69b5c7043a0ee15ce29d2b96dd9b;p=profile%2Ftv%2Fapps%2Fdotnet%2Fhome.git Show toast when the number of selected apps exceeds 10 Change-Id: I22a9b891d4a0a128b179808e91a9a7e3fd0b9e8b Signed-off-by: jjie.choi --- diff --git a/TVApps/TVApps/ViewModels/AppsHolder.cs b/TVApps/TVApps/ViewModels/AppsHolder.cs index 7461a4c..0117ca9 100755 --- a/TVApps/TVApps/ViewModels/AppsHolder.cs +++ b/TVApps/TVApps/ViewModels/AppsHolder.cs @@ -62,6 +62,8 @@ namespace TVApps.ViewModels /// public string UnpinnedAppName; + public bool IsSelectedExceeds; + /// /// A constructor /// Initializes installed and pinned app list @@ -197,6 +199,12 @@ namespace TVApps.ViewModels } else { + if(PinnedApps.Count >= 10) + { + IsSelectedExceeds = true; + ViewModel.OnPropertyChanged("IsSelectedExceeds"); + return; + } DebuggingUtils.Dbg("Pin! : " + selectedApp); selectedApp.IsChecked = true; selectedApp.IsPinned = true; diff --git a/TVApps/TVApps/ViewModels/MainPageViewModel.cs b/TVApps/TVApps/ViewModels/MainPageViewModel.cs index 84c3ea2..5c77900 100755 --- a/TVApps/TVApps/ViewModels/MainPageViewModel.cs +++ b/TVApps/TVApps/ViewModels/MainPageViewModel.cs @@ -118,6 +118,14 @@ namespace TVApps.ViewModels } } + public bool IsSelectedExceeds + { + get + { + return appsHolder.IsSelectedExceeds; + } + } + /// /// A command will be executed if the cancel button in FooterDeleteStatus is clicked /// @@ -439,5 +447,6 @@ namespace TVApps.ViewModels handler(this, new PropertyChangedEventArgs(propertyName)); } } + } } diff --git a/TVApps/TVApps/Views/MainPage.xaml b/TVApps/TVApps/Views/MainPage.xaml index 62a9fcf..1d3823a 100755 --- a/TVApps/TVApps/Views/MainPage.xaml +++ b/TVApps/TVApps/Views/MainPage.xaml @@ -10,7 +10,8 @@ IsEnabledDeletePopup="{Binding IsEnabledDeletePopup}" IsPinAppRequested="{Binding IsPinAppRequested}" DeletePopupAppLabel="{Binding DeletePopupAppLabel}" - DeletePopupCommand="{Binding DeletePopupCommand}"> + DeletePopupCommand="{Binding DeletePopupCommand}" + IsSelectedExceeds="{Binding IsSelectedExceeds}"> diff --git a/TVApps/TVApps/Views/MainPage.xaml.cs b/TVApps/TVApps/Views/MainPage.xaml.cs index 9764e59..f3abab6 100755 --- a/TVApps/TVApps/Views/MainPage.xaml.cs +++ b/TVApps/TVApps/Views/MainPage.xaml.cs @@ -111,6 +111,14 @@ namespace TVApps.Views set { SetValue(DeletePopupCommandProperty, value); } } + public static readonly BindableProperty IsSelectedExceedsProperty = BindableProperty.Create("IsSelectedExceeds", typeof(bool), typeof(FooterPinStatus), false, BindingMode.TwoWay); + + public bool IsSelectedExceeds + { + get { return (bool)GetValue(IsSelectedExceedsProperty); } + set { SetValue(IsSelectedExceedsProperty, value); } + } + /// /// A method for animation when application is terminated /// @@ -437,6 +445,14 @@ namespace TVApps.Views AppList.InitializeFocus(); } } + else if (e.PropertyName.Equals("IsSelectedExceeds")) + { + if (IsSelectedExceeds) + { + Toast.DisplayText("Number of selected apps exceeds 10."); + IsSelectedExceeds = false; + } + } } ///