コード例 #1
0
        private void PopulateCurrentMove(PointF pt, AgentAnnotationViewModel vm)
        {
            var point = ToAnnotationPoint(pt);
            var type = vm.AnnotationTools.Type.Value;

            currentBuilder = vm.CreateBuilder(type);
            currentBuilder.OnNextPoint(point);

            var annotation = vm.CreateAnnotationViewModel(currentBuilder.Annotation);
            vm.AddInProgressAnnotation(annotation);
        }
コード例 #2
0
        void AnnotationCanvas_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (CurrentAnnotationType == null) return;

            this.CaptureMouse();
            IsEditing = true;

            var p = e.GetPosition(this);
            var vm = DataContext as AgentAnnotationViewModel;


            _currentBuilder = vm.CreateBuilder(CurrentAnnotationType.Value);
            _currentAnnotation = vm.CreateAnnotationViewModel(_currentBuilder.Annotation);
            vm.AddInProgressAnnotation(_currentAnnotation);

            _currentBuilder.OnNextPoint(ConvertPoint(p));
        }
コード例 #3
0
        private void WrapUpMove()
        {
            _currentBuilder = null;
            _currentAnnotation = null;

            ReleaseMouseCapture();

            IsEditing = false;
            CurrentAnnotationType = null;
        }