private void BtnUndo_Click(object sender, RoutedEventArgs e) { if (EquationText.Length - 1 > 0) { string s = EquationText.Substring(0, EquationText.Length - 1); EquationText = s; } else { EquationText = ""; } }
public void InsertText(string s) { var index = TbEditor.CaretIndex; if (index == 0) { EquationText += s; } else { EquationText = EquationText.Insert(index, s); } }