public void OnRequestViewOperation(ViewOperationEventArgs e) { if (RequestViewOperation != null) { RequestViewOperation(e); } }
void DynamoViewModelRequestViewOperation(ViewOperationEventArgs e) { if (dynamoViewModel.BackgroundPreviewViewModel.CanNavigateBackground == false) return; switch (e.ViewOperation) { case ViewOperationEventArgs.Operation.FitView: if (dynamoViewModel.BackgroundPreviewViewModel != null) { dynamoViewModel.BackgroundPreviewViewModel.ZoomToFitCommand.Execute(null); return; } BackgroundPreview.View.ZoomExtents(); break; case ViewOperationEventArgs.Operation.ZoomIn: var camera1 = BackgroundPreview.View.CameraController; camera1.Zoom(-0.5 * BackgroundPreview.View.ZoomSensitivity); break; case ViewOperationEventArgs.Operation.ZoomOut: var camera2 = BackgroundPreview.View.CameraController; camera2.Zoom(0.5 * BackgroundPreview.View.ZoomSensitivity); break; } }
void DynamoViewModelRequestViewOperation(ViewOperationEventArgs e) { if (dynamoViewModel.CanNavigateBackground == false) return; switch (e.ViewOperation) { case ViewOperationEventArgs.Operation.FitView: background_preview.View.ZoomExtents(); break; case ViewOperationEventArgs.Operation.ZoomIn: var camera1 = background_preview.View.CameraController; camera1.Zoom(-0.5 * background_preview.View.ZoomSensitivity); break; case ViewOperationEventArgs.Operation.ZoomOut: var camera2 = background_preview.View.CameraController; camera2.Zoom(0.5 * background_preview.View.ZoomSensitivity); break; } }