private static void OnDisplayModeChanged(DependencyObject source, DependencyPropertyChangedEventArgs args) { BookDisplayMode mode = (BookDisplayMode)args.NewValue; KineBook book = source as KineBook; if (mode == BookDisplayMode.Normal) { //book.translate.X = 0; //book.scale.ScaleX = 1; //book.scale.ScaleY = 1; book.translate.BeginAnimation(TranslateTransform.XProperty, null); book.scale.BeginAnimation(ScaleTransform.ScaleXProperty, null); } else { if (book.CurrentPage == BookCurrentPage.LeftSheet) { book.AnimateToLeftSheet(); } else { book.AnimateToRightSheet(); } } }
private static void OnCurrentPageChanged(DependencyObject source, DependencyPropertyChangedEventArgs args) { BookCurrentPage currentPage = (BookCurrentPage)args.NewValue; KineBook b = source as KineBook; if (currentPage == BookCurrentPage.LeftSheet) { b.AnimateToRightSheet(); } else { b.AnimateToLeftSheet(); } }