GetItemContainerGenerator() private method

private GetItemContainerGenerator ( ) : ItemContainerGenerator
return System.Windows.Controls.ItemContainerGenerator
示例#1
0
 public static IEnumerable<CardControl> GetCardControls(GroupControl ctrl)
 {
     if (IsEmpty()) yield break;
       var groupCards = ctrl.Group.Cards;
       var generator = ctrl.GetItemContainerGenerator();
     for (int i = 0; i < groupCards.Count; ++i)
         if (groupCards[i].Selected)
         {
             var container = generator.ContainerFromIndex(i);
             var cardCtrl = (CardControl)System.Windows.Media.VisualTreeHelper.GetChild(container, 0);
             yield return cardCtrl;
         }
 }
示例#2
0
 public static IEnumerable<CardControl> GetCardControls(GroupControl ctrl)
 {
     if (IsEmpty()) yield break;
     ObservableCollection<Card> groupCards = ctrl.Group.Cards;
     ItemContainerGenerator generator = ctrl.GetItemContainerGenerator();
     for (int i = 0; i < groupCards.Count; ++i)
         if (groupCards[i].Selected)
         {
             DependencyObject container = generator.ContainerFromIndex(i);
             var cardCtrl = (CardControl) VisualTreeHelper.GetChild(container, 0);
             yield return cardCtrl;
         }
 }
示例#3
0
文件: Selection.cs 项目: wlk0/OCTGN
        public static IEnumerable <CardControl> GetCardControls(GroupControl ctrl)
        {
            if (IsEmpty())
            {
                yield break;
            }
            ObservableCollection <Card> groupCards = ctrl.Group.Cards;
            ItemContainerGenerator      generator  = ctrl.GetItemContainerGenerator();

            for (int i = 0; i < groupCards.Count; ++i)
            {
                if (groupCards[i].Selected)
                {
                    DependencyObject container = generator.ContainerFromIndex(i);
                    var cardCtrl = (CardControl)VisualTreeHelper.GetChild(container, 0);
                    yield return(cardCtrl);
                }
            }
        }