コード例 #1
0
        private static void SelectedRatingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            StarSelector s = d as StarSelector;

            s._rating = (int)e.NewValue;
            s.UpdateControlVisualState();
        }
コード例 #2
0
        /// <summary>
        /// Invoked when the <see cref="ReadOnlyProperty"/> is changed.
        /// </summary>
        /// <param name="d">The <see cref="DependencyObject"/> that raised the event.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void ReadOnlyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            StarSelector s = d as StarSelector;

            if (s != null)
            {
                s.ReadOnly = (bool)e.NewValue;
                s.UpdateControlVisualState();
            }
        }