Пример #1
0
        private static void OnFitModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(d))
            {
                return;
            }

            TwoPageBook element = d as TwoPageBook;

            element.Fit();
        }
Пример #2
0
        private static void OnCurrentPageIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(d))
            {
                return;
            }

            TwoPageBook element = d as TwoPageBook;

            element._currentSheetIndex = element.CurrentPageIndex / 2;
            element.RefreshSheetsContent();
        }
Пример #3
0
        private static void OnScaleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(d))
            {
                return;
            }

            TwoPageBook element = d as TwoPageBook;

            element._scaleTransform.ScaleX = (double)e.NewValue;
            element._scaleTransform.ScaleY = (double)e.NewValue;
        }
Пример #4
0
        private static object OnCoercePageIndex(DependencyObject d, object basevalue)
        {
            TwoPageBook element = d as TwoPageBook;

            int pageIndex = Convert.ToInt32(basevalue);

            if ((pageIndex < 0) || (pageIndex > element.GetItemsCount()))
            {
                basevalue = 0;
            }

            return(basevalue);
        }