コード例 #1
0
 protected void OnAnnotationViewModelAdded(AnnotationViewModel annotation)
 {
     var ev = AnnotationAdded;
     if (ev != null)
     {
         ev(this, new AnnotationViewModelAddedEventsArgs(annotation));
     }
 }
コード例 #2
0
 public void AddInProgressAnnotation(AnnotationViewModel annotation)
 {
     _annotations.Add(annotation);
     if (IsInCurrentPage(annotation))
     {
         this.RaisePropertyChanged("Annotations"); // rebinds to UI
     }
 }
コード例 #3
0
 protected bool IsInCurrentPage(AnnotationViewModel annotation)
 {
     return IsInCurrentPage(annotation.Annotation);
 }
コード例 #4
0
 public void AddInProgressAnnotation(AnnotationViewModel annotation)
 {
     _annotations.Add(annotation);
     if (IsInCurrentPage(annotation))
     {
         this.RaisePropertyChanged("Annotations"); // rebinds to UI
     }
 }
コード例 #5
0
 public AnnotationViewModel CreateAnnotationViewModel(Annotation annotation)
 {
     return(AnnotationViewModel.Create(annotation, SurfaceSize));
 }
コード例 #6
0
 protected bool IsInCurrentPage(AnnotationViewModel annotation)
 {
     return(IsInCurrentPage(annotation.Annotation));
 }
コード例 #7
0
 public AnnotationViewModelAddedEventsArgs(AnnotationViewModel annotation)
 {
     Annotation = annotation;
 }
コード例 #8
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));
        }
コード例 #9
0
        private void WrapUpMove()
        {
            _currentBuilder = null;
            _currentAnnotation = null;

            ReleaseMouseCapture();

            IsEditing = false;
            CurrentAnnotationType = null;
        }