public void ClickFocusedItem() { RadGalleryPopupElement popupElement = this.PopupElement as RadGalleryPopupElement; if (popupElement == null) { return; } List <RadElement> descendants = popupElement.GetDescendants(new Predicate <RadElement>(this.IsGaleryItem), TreeTraversalMode.BreadthFirst); descendants.Sort(new Comparison <RadElement>(this.GalleryItemsComparison)); for (int index = 0; index < descendants.Count; ++index) { if (descendants[index].IsMouseOver) { descendants[index].PerformClick(); break; } } }
protected override bool ProcessUpDownNavigationKey(bool isUp) { RadGalleryPopupElement popupElement = this.PopupElement as RadGalleryPopupElement; if (popupElement == null) { return(false); } List <RadElement> descendants = popupElement.GetDescendants(new Predicate <RadElement>(this.IsGaleryItem), TreeTraversalMode.BreadthFirst); descendants.Sort(new Comparison <RadElement>(this.GalleryItemsComparison)); for (int currentIndex = 0; currentIndex < descendants.Count; ++currentIndex) { if (descendants[currentIndex].IsMouseOver) { if (isUp) { this.FocusItem(descendants[currentIndex], this.FindUpperItem(currentIndex, descendants)); } else { this.FocusItem(descendants[currentIndex], this.FindLowerItem(currentIndex, descendants)); } return(true); } } if (descendants.Count == 0) { this.FocusItem((RadElement)null, (RadElement)null); } else { this.FocusItem((RadElement)null, descendants[0]); } return(true); }
protected override bool ProcessLeftRightNavigationKey(bool isLeft) { RadGalleryPopupElement popupElement = this.PopupElement as RadGalleryPopupElement; if (popupElement == null) { return(false); } List <RadElement> descendants = popupElement.GetDescendants(new Predicate <RadElement>(this.IsGaleryItem), TreeTraversalMode.BreadthFirst); descendants.Sort(new Comparison <RadElement>(this.GalleryItemsComparison)); for (int index = 0; index < descendants.Count; ++index) { if (descendants[index].IsMouseOver) { if (isLeft) { this.FocusItem(descendants[index], index > 0 ? descendants[index - 1] : (RadElement)null); } else { this.FocusItem(descendants[index], index + 1 < descendants.Count ? descendants[index + 1] : (RadElement)null); } return(true); } } if (descendants.Count == 0) { this.FocusItem((RadElement)null, (RadElement)null); } else { this.FocusItem((RadElement)null, isLeft ? descendants[descendants.Count] : descendants[0]); } return(true); }