示例#1
0
            public IDockedAnnotation GetDockedAnnotation()
            {
                if (this.dockedAnnotation == null)
                {
                    DockedAnnotationView view = new DockedAnnotationView();

                    Binding annotationTextbinding = new Binding("ModelItem.AnnotationText");
                    view.SetBinding(DockedAnnotationView.AnnotationTextProperty, annotationTextbinding);

                    Binding maxWidthBinding = new Binding("ActualWidth");
                    maxWidthBinding.ElementName = "annotationWidthSetter";
                    view.SetBinding(DockedAnnotationView.MaxWidthProperty, maxWidthBinding);

                    this.dockedAnnotation = view;
                    this.decorator.Child  = view;
                }

                return(this.dockedAnnotation);
            }
            public IDockedAnnotation GetDockedAnnotation()
            {
                if (this.dockedAnnotation == null)
                {
                    DockedAnnotationView view = new DockedAnnotationView();
                    Binding binding           = new Binding("ModelItem.AnnotationText");
                    view.SetBinding(DockedAnnotationView.AnnotationTextProperty, binding);
                    view.Visibility = Visibility.Collapsed;
                    Grid.SetRow(view, 0);

                    this.dockedAnnotation = view;
                    this.designer.rootGrid.Children.Insert(0, view);
                }

                return(this.dockedAnnotation);
            }