public override System.Windows.Style SelectStyle(object item, System.Windows.DependencyObject container) { if (ContainerStyle1 == null) return null; TCheckListBoxItem citem = container as TCheckListBoxItem; TCheckListBox listView = ItemsControl.ItemsControlFromItemContainer(container) as TCheckListBox; int index =listView.ItemContainerGenerator.IndexFromContainer(container); if (index % 2 == 0) { citem.IsOddIndex = true; //IsOddIndex.Value = true; } else { citem.IsOddIndex = false; // IsOddIndex.Value = false; } return ContainerStyle1; }
时间: 2024-10-09 07:40:13