コード例 #1
0
        /// <summary>
        /// Raises an DropDownClosing event when the IsDropDownOpen property is
        /// changing from true to false.
        /// </summary>
        /// <param name="e">
        /// Provides any observers the opportunity to cancel the operation
        /// and halt closing the drop down.
        /// </param>
        protected virtual void OnDropDownClosing(RoutedPropertyChangingEventArgs <bool> e)
        {
            RoutedPropertyChangingEventHandler <bool> handler = DropDownClosing;

            if (handler != null)
            {
                handler(this, e);
            }
        }
コード例 #2
0
        protected virtual void OnValueChanging(RoutedPropertyChangingEventArgs <DateTime?> e)
        {
            // change is from value itself.
            bool success = _timeCoercionHelper.CoerceValue(e.OldValue, e.NewValue);

            if (success)
            {
                e.InCoercion = false;
                e.NewValue   = Value;
                RoutedPropertyChangingEventHandler <DateTime?> handler = ValueChanging;
                if (handler != null)
                {
                    handler(this, e);
                }
            }
            else
            {
                e.InCoercion = true;
            }
        }