Ejemplo n.º 1
0
        private static bool ValidateItemTemplate(BindableObject b, object v)
        {
            ItemsView view = b as ItemsView;
#if !__ANDROID__
            if ((view != null) && (view.CachingStrategy == ListViewCachingStrategy.RetainElement))
            {
                return !(view.ItemTemplate is DataTemplateSelector);
            }
#endif
            return true;
        }
Ejemplo n.º 2
0
 private static void OnSelectedItemChanged(BindableObject bindable, object oldValue, object newValue)
 {
     ItemsView view = (ItemsView)bindable;
     for (int count = 0; count < view.ItemsStackLayout.Children.Count - 1; count++)
     {
         if (view.ItemsStackLayout.Children[count].BindingContext == newValue)
         {
             view.ItemsStackLayout.Children[count].BackgroundColor = Xamarin.Forms.Color.Blue;
         } else
         {
             view.ItemsStackLayout.Children[count].BackgroundColor = Xamarin.Forms.Color.White;
         }
     }
     if (view.ItemSelected != null)
     {
         view.ItemSelected(view, new SelectedItemChangedEventArgs(newValue));
     }
 }