public void Invoke() { RadRating rating = this.RatingItem.Owner; RadRatingItem selectedRatingItem = rating.Items.LastOrDefault(item => rating.GetIndexOf(item) < rating.Value); if (selectedRatingItem != null && selectedRatingItem == this.RatingItem) { this.RatingItem.Owner.Value = 0d; } else { this.RatingItem.Select(); } }
/// <summary> /// Not implemented in this single-value control. /// </summary> public void AddToSelection() { if (!this.IsSelected) { RadRating rating = this.RatingItem.Owner; RadRatingItem selectedRatingItem = rating.Items.LastOrDefault(item => rating.GetIndexOf(item) < rating.Value); if (selectedRatingItem != null && selectedRatingItem != this.RatingItem) { throw new ArgumentException("Rating supports only single selection."); } this.Select(); } else { throw new InvalidOperationException("Element is already selected"); } }