private static void ReadOnly_PropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { CommentBoxControl commentBox = d as CommentBoxControl; if (commentBox != null) { commentBox.IsReadOnly = (bool)e.NewValue; } }
private static void Text_PropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { CommentBoxControl commentBox = d as CommentBoxControl; if (commentBox != null) { commentBox.Text = (string)e.NewValue; } }
private Annotation Create (Rect rect, string commentText, bool IsReadOnly, double radiusX, double radiusY) { Pen pen = new Pen(Brushes.Goldenrod, 3); pen.LineJoin = PenLineJoin.Round; CommentBoxControl commentBox = new CommentBoxControl(); commentBox.IsReadOnly = IsReadOnly; commentBox.Text = commentText; commentBox.Width = 275; commentBox.Height = 165; visualChildren.Add(commentBox); Annotation annotation = new Annotation(pen, new RectangleGeometry(rect, radiusX, radiusY), commentBox, commentText, IsReadOnly); return annotation; }
public Annotation (Pen pen, RectangleGeometry marking, CommentBoxControl commentBox, string commentText, bool isReadOnly, bool isSelected) : this(pen, marking, commentBox, commentText, isReadOnly) { _IsSelected = isSelected; }
public Annotation (Pen pen, RectangleGeometry marking, CommentBoxControl commentBox, string commentText, bool isReadOnly) : this(pen, marking, commentBox, isReadOnly) { _CommentText = commentText; }
public Annotation (Pen pen, RectangleGeometry marking, CommentBoxControl commentBox, bool isReadOnly) { _Pen = pen; _Marking = marking; _CommentBox = commentBox; _IsReadOnly = isReadOnly; if (_CommentBox != null) { _CommentBox.TextChangedEvent += new EventHandler(CommentBox_TextChanged); } }