Example #1
0
 internal void TearDown()
 {
     this.sceneView.ViewModel.AnimationEditor.RecordModeChanged -= new EventHandler(this.AnimationEditor_RecordModeChanged);
     this.sceneView.ViewModel.LateSceneUpdatePhase -= new SceneUpdatePhaseEventHandler(this.ViewModel_LateSceneUpdate);
     this.artboard.ZoomChanged   -= new EventHandler(this.Artboard_ZoomChanged);
     this.artboard.CenterChanged -= new EventHandler(this.Artboard_CenterChanged);
     this.artboard.SnapToGridRenderer.Detach();
     if (this.sceneView.ViewModel.DesignerContext != null)
     {
         AnnotationService annotationService = this.sceneView.DesignerContext.AnnotationService;
         if (annotationService != null)
         {
             annotationService.ShowAnnotationsChanged    -= new EventHandler(this.AnnotationService_ShowAnnotationsChanged);
             annotationService.AnnotationsEnabledChanged -= new EventHandler(this.AnnotationService_AnnotationsEnabledChanged);
         }
     }
     if (this.sceneView.ViewModel.DesignerContext.SnappingEngine != null)
     {
         this.sceneView.ViewModel.DesignerContext.ArtboardOptionsChanged -= new EventHandler(this.OnArtboardOptionsChanged);
     }
     if (this.sceneView.ViewModel.DesignerContext.WindowService != null)
     {
         this.sceneView.ViewModel.DesignerContext.WindowService.ThemeChanged -= new EventHandler(this.WindowManager_ThemeChanged);
     }
     this.LayoutUpdated -= new EventHandler(this.SceneScrollViewer_LayoutUpdated);
     this.horizontalScrollBar.ValueChanged -= new RoutedPropertyChangedEventHandler <double>(this.HorizontalScrollBar_ValueChanged);
     this.verticalScrollBar.ValueChanged   -= new RoutedPropertyChangedEventHandler <double>(this.VerticalScrollBar_ValueChanged);
     this.horizontalScrollBar = (ExtendedScrollBar)null;
     this.verticalScrollBar   = (ExtendedScrollBar)null;
     this.artboard.TearDown();
     this.artboard  = (Artboard)null;
     this.Child     = (UIElement)null;
     this.sceneView = (SceneView)null;
 }
        private void UpdateScrollExtents(bool isZooming)
        {
            ScrollViewer      scrollViewer      = (ScrollViewer)this.Viewers[0];
            ExtendedScrollBar extendedScrollBar = (ExtendedScrollBar)this.ScrollBar;
            double            num1 = TimelineView.PositionFromSeconds(Math.Max(this.timelineView.LastSignificantTime, TimelineView.SecondsFromPosition(scrollViewer.RenderSize.Width)) + 1.0) - scrollViewer.RenderSize.Width;

            if (isZooming)
            {
                if (this.wasCurrentTimeVisible)
                {
                    this.centerTime = this.timelineView.CurrentTime;
                }
                double num2 = Math.Max(0.0, TimelineView.PositionFromSeconds(this.centerTime) - this.visibleWidth / 2.0);
                extendedScrollBar.ContentMaximum = num1;
                extendedScrollBar.Value          = num2;
            }
            else
            {
                extendedScrollBar.ContentMaximum = num1;
            }
        }
Example #3
0
 private void CreateComponents()
 {
     this.Child = (UIElement)Microsoft.Expression.DesignSurface.FileTable.GetElement("Resources\\SceneScrollViewer.xaml");
     this.zoomFitToScreenItem = ((FrameworkElement)this.Child).FindName("ZoomFitToScreenItem") as ComboBoxItem;
     this.horizontalScrollBar = (ExtendedScrollBar)ElementUtilities.FindElement((FrameworkElement)this, "HorizontalScrollBar");
     this.horizontalScrollBar.ValueChanged += new RoutedPropertyChangedEventHandler <double>(this.HorizontalScrollBar_ValueChanged);
     this.verticalScrollBar = (ExtendedScrollBar)ElementUtilities.FindElement((FrameworkElement)this, "VerticalScrollBar");
     this.verticalScrollBar.ValueChanged += new RoutedPropertyChangedEventHandler <double>(this.VerticalScrollBar_ValueChanged);
     ((Decorator)ElementUtilities.FindElement((FrameworkElement)this, "ArtboardBorder")).Child = (UIElement)this.artboard;
     this.artboard.DataContext      = (object)null;
     this.artboard.FocusVisualStyle = (Style)null;
     InputMethod.SetIsInputMethodEnabled((DependencyObject)this.artboard, false);
     this.artboard.ZoomPresetCollection = SceneScrollViewer.zoomPresetCollection;
     this.artboard.ZoomComboCollection  = SceneScrollViewer.zoomComboCollection;
     this.artboard.ZoomChanged         += new EventHandler(this.Artboard_ZoomChanged);
     this.artboard.CenterChanged       += new EventHandler(this.Artboard_CenterChanged);
     this.artboard.SnapToGridRenderer.Attach(this.sceneView.ViewModel.DesignerContext);
     if (this.sceneView.ViewModel.DesignerContext != null)
     {
         AnnotationService annotationService = this.sceneView.DesignerContext.AnnotationService;
         if (annotationService != null)
         {
             annotationService.ShowAnnotationsChanged    += new EventHandler(this.AnnotationService_ShowAnnotationsChanged);
             annotationService.AnnotationsEnabledChanged += new EventHandler(this.AnnotationService_AnnotationsEnabledChanged);
         }
     }
     if (this.sceneView.ViewModel.DesignerContext.SnappingEngine != null)
     {
         this.sceneView.ViewModel.DesignerContext.ArtboardOptionsChanged += new EventHandler(this.OnArtboardOptionsChanged);
     }
     if (this.sceneView.ViewModel.DesignerContext.WindowService != null)
     {
         this.sceneView.ViewModel.DesignerContext.WindowService.ThemeChanged += new EventHandler(this.WindowManager_ThemeChanged);
     }
     this.sceneView.ViewModel.LateSceneUpdatePhase += new SceneUpdatePhaseEventHandler(this.ViewModel_LateSceneUpdate);
     this.UpdateSmallChange();
 }