Example #1
0
        private static void OnCommandChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            RadRating rating = sender as RadRating;

            if (rating.canExecuteChangedHandler != null)
            {
                rating.canExecuteChangedHandler.Unsubscribe();
            }

            System.Windows.Input.ICommand command = args.NewValue as System.Windows.Input.ICommand;
            if (command != null)
            {
                rating.canExecuteChangedHandler = new WeakEventHandler <EventArgs>(command, rating, KnownEvents.CanExecuteChanged);
                rating.UpdateIsReadOnlyFromCommand();
            }
        }
Example #2
0
        private static void OnCommandParameterChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
        {
            RadRating rating = sender as RadRating;

            rating.UpdateIsReadOnlyFromCommand();
        }