コード例 #1
0
ファイル: RadRating.cs プロジェクト: zyhong/UI-For-UWP
        private static void OnRatingDisplayPrecisionChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            RadRating rating = sender as RadRating;

            rating.UpdateDisplayValue();
            rating.UpdateFillRatio();
        }
コード例 #2
0
ファイル: RadRating.cs プロジェクト: zyhong/UI-For-UWP
        private static void OnAutoGeneratedItemsCountChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            RadRating rating = sender as RadRating;

            if (!rating.IsTemplateApplied)
            {
                return;
            }

            if ((int)args.OldValue == 0 && rating.itemsSource.Count != 0)
            {
                throw new InvalidOperationException(AutoGeneratedItemsCountExceptionMessage);
            }

            rating.isItemsSourceChangedSilently = true;
            rating.itemsSource.Clear();
            int newValue = (int)args.NewValue;

            if (newValue <= 0)
            {
                rating.AutoGeneratedItemsCount = 0;
            }
            else
            {
                rating.GenerateRatingItems();

                double coercedValue = RadMath.CoerceValue(rating.Value, 0, rating.itemsSource.Count);
                if (rating.Value != coercedValue)
                {
                    rating.SetValuePropertySilently(ValueProperty, coercedValue);
                    rating.UpdateDisplayValue();
                    rating.UpdateFillRatio();
                }
            }

            rating.isItemsSourceChangedSilently = false;
            rating.PopulateRatingPanel();
        }
コード例 #3
0
ファイル: RadRating.cs プロジェクト: zyhong/UI-For-UWP
        private static void OnRatingSelectionModeChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            RadRating rating = sender as RadRating;

            rating.UpdateFillRatio();
        }