Пример #1
0
        private void RemoveTextbox(CustomTextBox textbox)
        {
            if (textbox != null)
            {
                graphCanvas.RemoveTextBox(textbox);
                textbox.Visibility = Visibility.Collapsed;

                if (this.editTextbox == textbox)
                    this.editTextbox = null;
            }
        }
Пример #2
0
 private void CreateEditTextbox(bool allowNewLine, SolidColorBrush backgroundColor, String font, FontWeight weight, double fontSize, double minTextboxWidth)
 {
     editTextbox = new CustomTextBox(graphCanvas, allowNewLine, backgroundColor, font, weight, fontSize, Configurations.TextboxMaxWidth, minTextboxWidth);
     graphCanvas.AddTextbox(editTextbox);
     editTextbox.Visibility = Visibility.Visible;
     editTextbox.PreviewKeyDown += OnInternalTextboxPreviewKeyDown;
     editTextbox.InternalTextBox.TextChanged += new TextChangedEventHandler(OnInternalTextBoxTextChanged);
     editTextbox.LostKeyboardFocus += new KeyboardFocusChangedEventHandler(OnInternalTextBoxLostKeyboardFocus);
 }