コード例 #1
0
        protected internal virtual void OnDeactivated(RoutedEventArgs eventArgs)
        {
            Debug.Assert(IsActive, "DockTabItem.OnDeactivated should only be called when item is active.");

            IsActive = false;

            // Raise Deactivated event.
            Debug.Assert(eventArgs.RoutedEvent == DeactivatedEvent, "Invalid arguments for DockTabItem.OnDeactivated.");
            RaiseEvent(eventArgs);

            // Update visual states.
            UpdateVisualStates(true);
            DockTabPane?.UpdateVisualStates(true);
        }
コード例 #2
0
        protected internal virtual void OnActivated(RoutedEventArgs eventArgs)
        {
            Debug.Assert(!IsActive, "DockTabItem.OnActivated should not be called when item is active.");

            // Set DockControl.ActiveDockTabPane/ActiveDockTabItem.
            SetActiveItem();

            IsActive = true;

            // Deactivate other DockTabItems and raise Deactivated event.
            DeactivateOtherItems();

            // Raise Activated event.
            Debug.Assert(eventArgs.RoutedEvent == ActivatedEvent, "Invalid arguments for DockTabItem.OnActivated.");
            RaiseEvent(eventArgs);

            // Update visual states.
            UpdateVisualStates(true);
            DockTabPane?.UpdateVisualStates(true);
        }