Esempio n. 1
0
 public PDRatingView(RatingConfig config)
 {
     UserInteractionEnabled = true;
      MultipleTouchEnabled = true;
      ExclusiveTouch = true;
      StarRatingConfig = config;
      StarViews = new List<RatingItemView>();
      Enumerable.Range(0, StarRatingConfig.ScaleSize).ToList().ForEach(i =>
      {
     int starRating = i + 1;
     RatingItemView starView = new RatingItemView(StarRatingConfig.EmptyImage, StarRatingConfig.FilledImage,
                                  StarRatingConfig.ChosenImage, this);
     StarViews.Add(starView);
     StarViews[i].StarRating = starRating;
     Add(starView);
      });
 }
Esempio n. 2
0
 public PDRatingView(RatingConfig config)
 {
     StarRatingConfig   = config;
     StarViews          = new List <RatingItemView>();
     ButtonsAndHandlers = new Dictionary <UIButton, EventHandler>();
     Enumerable.Range(0, StarRatingConfig.ScaleSize).ToList().ForEach(i => {
         int starRating          = i + 1;
         RatingItemView starView = new RatingItemView(emptyImage: StarRatingConfig.EmptyImage,
                                                      filledImage: StarRatingConfig.FilledImage,
                                                      chosenImage: StarRatingConfig.ChosenImage);
         StarViews.Add(starView);
         EventHandler handler = (s, e) => {
             ChosenRating = starRating;
             RatingChosen(this, new RatingChosenEventArgs(ChosenRating.Value));
         };
         ButtonsAndHandlers.Add(starView, handler);
         Add(starView);
     });
     AssignHandlers();
 }
Esempio n. 3
0
 public PDRatingView(RatingConfig config) {
     StarRatingConfig = config;
     StarViews = new List<RatingItemView>();
     ButtonsAndHandlers = new Dictionary<UIButton, EventHandler>();
     Enumerable.Range(0, StarRatingConfig.ScaleSize).ToList().ForEach(i => {
         int starRating = i + 1;
         RatingItemView starView = new RatingItemView(emptyImage: StarRatingConfig.EmptyImage,
                                       filledImage: StarRatingConfig.FilledImage,
                                       chosenImage: StarRatingConfig.ChosenImage);
         StarViews.Add(starView);
         EventHandler handler = (s, e) => {
             ChosenRating = starRating;
             RatingChosen(this, new RatingChosenEventArgs(ChosenRating.Value));
         };
         ButtonsAndHandlers.Add(starView, handler);
         Add(starView);
     });
     AssignHandlers();
 }