private static void OnFitModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if (System.ComponentModel.DesignerProperties.GetIsInDesignMode(d)) { return; } TwoPageBook element = d as TwoPageBook; element.Fit(); }
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(); }
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; }
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); }