예제 #1
0
        /// <summary>
        /// Raises the <see cref="DragCompleted"/> event.
        /// </summary>
        private void RaiseDragCompleted(Double hchange, Double vchange)
        {
            var evtData     = RoutedEventData.Retrieve(this);
            var evtDelegate = EventManager.GetInvocationDelegate <UpfDragCompletedEventHandler>(DragCompletedEvent);

            evtDelegate(this, hchange, vchange, evtData);
        }
예제 #2
0
        /// <summary>
        /// Raises the <see cref="ClickByUser"/> event.
        /// </summary>
        protected virtual void OnClickByUser()
        {
            var evtData     = RoutedEventData.Retrieve(this);
            var evtDelegate = EventManager.GetInvocationDelegate <UpfRoutedEventHandler>(ClickByUserEvent);

            evtDelegate(this, evtData);
        }
예제 #3
0
        /// <summary>
        /// Raises the <see cref="DragStarted"/> event.
        /// </summary>
        private void RaiseDragStarted(Double hoffset, Double voffset)
        {
            var evtData     = RoutedEventData.Retrieve(this);
            var evtDelegate = EventManager.GetInvocationDelegate <UpfDragStartedEventHandler>(DragStartedEvent);

            evtDelegate(this, hoffset, voffset, evtData);
        }
예제 #4
0
        /// <summary>
        /// Raises the <see cref="TextChanged"/> routed event.
        /// </summary>
        protected virtual void OnTextChanged()
        {
            var evtDelegate = EventManager.GetInvocationDelegate <UpfRoutedEventHandler>(TextChangedEvent);
            var evtData     = RoutedEventData.Retrieve(this);

            evtDelegate(this, evtData);
        }
예제 #5
0
        /// <summary>
        /// Raises the <see cref="Indeterminate"/> event.
        /// </summary>
        protected virtual void OnIndeterminate()
        {
            var evtData     = RoutedEventData.Retrieve(this);
            var evtDelegate = EventManager.GetInvocationDelegate <UpfRoutedEventHandler>(IndeterminateEvent);

            evtDelegate(this, evtData);
        }
        /// <summary>
        /// Raises the <see cref="PasswordBox.PasswordChangedEvent"/> routed event against the editor's templated parent.
        /// </summary>
        private void RaisePasswordChanged(PasswordBox target)
        {
            var evtDelegate = EventManager.GetInvocationDelegate <UpfRoutedEventHandler>(PasswordBox.PasswordChangedEvent);
            var evtData     = RoutedEventData.Retrieve(target);

            evtDelegate(target, evtData);
        }
        /// <summary>
        /// Raises the <see cref="Scroll"/> event.
        /// </summary>
        /// <param name="type">The scroll event type.</param>
        protected internal void RaiseScrollEvent(ScrollEventType type)
        {
            var evtData     = RoutedEventData.Retrieve(this);
            var evtDelegate = EventManager.GetInvocationDelegate <UpfScrollEventHandler>(ScrollEvent);

            evtDelegate(this, type, evtData);
        }
예제 #8
0
        /// <summary>
        /// Raises the <see cref="Click"/> event.
        /// </summary>
        protected virtual void OnClick()
        {
            var evtData     = RoutedEventData.Retrieve(this);
            var evtDelegate = EventManager.GetInvocationDelegate <UpfRoutedEventHandler>(ClickEvent);

            evtDelegate(this, evtData);

            CommandManager.ExecuteSource(View, this);
        }
예제 #9
0
        /// <summary>
        /// Raises the SelectionChanged event.
        /// </summary>
        private void RaiseSelectionChanged()
        {
            if (suspendSelectionChangedLevel > 0)
            {
                return;
            }

            var evtDelegate = EventManager.GetInvocationDelegate <UpfRoutedEventHandler>(SelectionChangedEvent);
            var evtData     = RoutedEventData.Retrieve(this);

            evtDelegate(this, evtData);
        }
예제 #10
0
        /// <summary>
        /// Handles <see cref="Scroll"/> events raised by the scroll bar's child scroll bars.
        /// </summary>
        private static void HandleScrollEvent(DependencyObject element, ScrollEventType type, RoutedEventData data)
        {
            var scrollbar = (ScrollBar)element;
            var hscroll   = scrollbar.PART_HScrollBar;
            var vscroll   = scrollbar.PART_VScrollBar;

            if (data.OriginalSource == hscroll || data.OriginalSource == vscroll)
            {
                // Re-raise the event with this control as the source
                var evtData     = RoutedEventData.Retrieve(scrollbar);
                var evtDelegate = EventManager.GetInvocationDelegate <UpfScrollEventHandler>(ScrollEvent);
                evtDelegate(scrollbar, type, evtData);

                data.Handled = true;
            }
        }
예제 #11
0
        /// <summary>
        /// Occurs when the value of the <see cref="IsSelected"/> dependency property changes.
        /// </summary>
        private static void HandleIsSelectedChanged(DependencyObject dobj, Boolean oldValue, Boolean newValue)
        {
            var item = (ListBoxItem)dobj;

            if (item.IsSelected)
            {
                var evtDelegate = EventManager.GetInvocationDelegate <UpfRoutedEventHandler>(Selector.SelectedEvent);
                var evtData     = RoutedEventData.Retrieve(dobj);
                evtDelegate(dobj, evtData);
            }
            else
            {
                var evtDelegate = EventManager.GetInvocationDelegate <UpfRoutedEventHandler>(Selector.UnselectedEvent);
                var evtData     = RoutedEventData.Retrieve(dobj);
                evtDelegate(dobj, evtData);
            }

            item.UpdateHighlightOpacity();
        }
예제 #12
0
        /// <summary>
        /// Occurs when the value of the <see cref="IsSelected"/> dependency property changes.
        /// </summary>
        private static void HandleIsSelectedChanged(DependencyObject dobj, Boolean oldValue, Boolean newValue)
        {
            var item = (TabItem)dobj;

            if (item.IsSelected)
            {
                item.Classes.Set("selected");

                var evtDelegate = EventManager.GetInvocationDelegate <UpfRoutedEventHandler>(Selector.SelectedEvent);
                var evtData     = RoutedEventData.Retrieve(dobj);
                evtDelegate(dobj, evtData);
            }
            else
            {
                item.Classes.Remove("selected");

                var evtDelegate = EventManager.GetInvocationDelegate <UpfRoutedEventHandler>(Selector.UnselectedEvent);
                var evtData     = RoutedEventData.Retrieve(dobj);
                evtDelegate(dobj, evtData);
            }
        }