コード例 #1
0
        /// <summary>
        /// Handles a change to the IsLayoutFrozen property.
        /// </summary>
        /// <param name="dependencyObject">The object that owns the property.</param>
        /// <param name="dependencyPropertyChangedEventArgs">A description of the changed property.</param>
        private static void OnIsLayoutFrozenChanged(DependencyObject dependencyObject,
                                                    DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            // Extract the strongly typed variables from the generic parameters.
            ViewerBlotter viewerPrototype = dependencyObject as ViewerBlotter;
            Boolean       isLayoutFrozen  = (Boolean)dependencyPropertyChangedEventArgs.NewValue;

            // This takes care of the actual work of setting the filter to display only the filled orders (or removing the filter).
            ViewerBlotter.reportWorkingOrder.IsLayoutFrozen = isLayoutFrozen;
        }
コード例 #2
0
        /// <summary>
        /// Handles a change to the Scale property.
        /// </summary>
        /// <param name="dependencyObject">The object that owns the property.</param>
        /// <param name="dependencyPropertyChangedEventArgs">A description of the changed property.</param>
        private static void OnScaleChanged(
            DependencyObject dependencyObject,
            DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            // Extract the strongly typed variables from the generic parameters.
            ViewerBlotter viewerPrototype = dependencyObject as ViewerBlotter;
            Double        scale           = (Double)dependencyPropertyChangedEventArgs.NewValue;

            // Set the animation speed on the report.
            ViewerBlotter.reportWorkingOrder.Scale = scale;
            ViewerBlotter.reportMatch.Scale        = scale;
            ViewerBlotter.reportExecution.Scale    = scale;
        }
コード例 #3
0
        /// <summary>
        /// Handles a change to the IsNavigationPaneVisible property.
        /// </summary>
        /// <param name="dependencyObject">The object that owns the property.</param>
        /// <param name="dependencyPropertyChangedEventArgs">A description of the changed property.</param>
        private static void OnIsNavigationPaneVisibleChanged(DependencyObject dependencyObject,
                                                             DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            // Extract the strongly typed variables from the generic parameters.
            ViewerBlotter viewerPrototype         = dependencyObject as ViewerBlotter;
            Boolean       isNavigationPaneVisible = (Boolean)dependencyPropertyChangedEventArgs.NewValue;

            // The real logic is handled by the application window.  This handler is only got to update the menu user interface to
            // reflect the state of the navigation pane.
            if (viewerPrototype.menuItemIsNavigationPaneVisible.IsChecked != isNavigationPaneVisible)
            {
                viewerPrototype.menuItemIsNavigationPaneVisible.IsChecked = isNavigationPaneVisible;
            }
        }
コード例 #4
0
        /// <summary>
        /// Handles a change to the AnimationSpeed property.
        /// </summary>
        /// <param name="dependencyObject">The object that owns the property.</param>
        /// <param name="dependencyPropertyChangedEventArgs">A description of the changed property.</param>
        private static void OnAnimationSpeedChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            // Extract the strongly typed variables from the generic parameters.
            ViewerBlotter  viewerPrototype = dependencyObject as ViewerBlotter;
            AnimationSpeed animationSpeed  = (AnimationSpeed)dependencyPropertyChangedEventArgs.NewValue;

            // Set the animation speed on the report.
            ViewerBlotter.reportWorkingOrder.AnimationSpeed = animationSpeed;

            // Adjust the menu items for the new animation setting.
            viewerPrototype.menuItemSetAnimationFast.IsChecked   = animationSpeed == AnimationSpeed.Fast;
            viewerPrototype.menuItemSetAnimationMedium.IsChecked = animationSpeed == AnimationSpeed.Medium;
            viewerPrototype.menuItemSetAnimationOff.IsChecked    = animationSpeed == AnimationSpeed.Off;
            viewerPrototype.menuItemSetAnimationSlow.IsChecked   = animationSpeed == AnimationSpeed.Slow;
        }
コード例 #5
0
        /// <summary>
        /// Handles a change to the IsHeaderFrozen property.
        /// </summary>
        /// <param name="dependencyObject">The object that owns the property.</param>
        /// <param name="dependencyPropertyChangedEventArgs">A description of the changed property.</param>
        private static void OnIsHeaderFrozenChanged(DependencyObject dependencyObject,
                                                    DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            // Extract the strongly typed variables from the generic parameters.
            ViewerBlotter viewerPrototype = dependencyObject as ViewerBlotter;
            Boolean       isHeaderFrozen  = (Boolean)dependencyPropertyChangedEventArgs.NewValue;

            // This takes care of the actual work of setting the filter to display only the filled orders (or removing the filter).
            ViewerBlotter.reportWorkingOrder.IsHeaderFrozen = isHeaderFrozen;
            ViewerBlotter.reportMatch.IsHeaderFrozen        = isHeaderFrozen;
            ViewerBlotter.reportExecution.IsHeaderFrozen    = isHeaderFrozen;

            // The user interface is modified here to reflect the change to the property.
            if (viewerPrototype.toggleButtonIsHeaderFrozen.IsChecked != isHeaderFrozen)
            {
                viewerPrototype.toggleButtonIsHeaderFrozen.IsChecked = isHeaderFrozen;
            }
        }