private double scrubberTargetTime = 0; //Used for snapping the scrubber to the beginning/ending of timeline entries while dragging #endregion public TimelineView() { InitializeComponent(); //Subscribe to the scrubber drag monitor, so we can be informed when the user drags the scrubber scrubberDragMonitor = new MouseDragMonitor(scrubHandle, MouseButton.Left); scrubberDragMonitor.DragStarted += scrubHandle_DragStarted; scrubberDragMonitor.DragMoved += scrubHandle_DragMoved; }
public TimelineEntryControl(TimelineEntry timelineEntry, TimelineLayerView parentLayerView) { this.timelineEntry = timelineEntry; this.parentLayerView = parentLayerView; InitializeComponent(); //Initialize the drag monitors leftHandleDragMonitor = new MouseDragMonitor(leftHandle, MouseButton.Left); leftHandleDragMonitor.DragMoved += LeftHandleDragMonitor_DragMoved; leftHandleDragMonitor.DragReleased += LeftHandleDragMonitor_DragReleased; rightHandleDragMonitor = new MouseDragMonitor(rightHandle, MouseButton.Left); rightHandleDragMonitor.DragMoved += RightHandleDragMonitor_DragMoved; rightHandleDragMonitor.DragReleased += RightHandleDragMonitor_DragReleased; moveDragMonitor = new MouseDragMonitor(visibleRectangle, MouseButton.Left); moveDragMonitor.DragMoved += MoveDragMonitor_DragMoved; moveDragMonitor.DragReleased += MoveDragMonitor_DragReleased; }
public MainWindow() { InitializeComponent(); //Subscribe to the timeline pan watcher so we can be informed when the user pans timelinePanWatcher = new MouseDragMonitor(timelineView, MouseButton.Middle); timelinePanWatcher.DragMoved += TimelinePanWatcher_DragMoved; //Set up the timeline view TimelineLayerView layerA = new TimelineLayerView(); TimelineLayerView layerB = new TimelineLayerView(); timelineView.AddLayer(layerA); timelineView.AddLayer(layerB); layerA.AddEntry(new TimelineEntry("0-10", 0, 10, null)); layerB.AddEntry(new TimelineEntry("0-10", 0, 10, null)); layerA.AddEntry(new TimelineEntry("20-25", 20, 25, null)); layerB.AddEntry(new TimelineEntry("20-25", 20, 25, null)); }