예제 #1
0
        private void CodeEditor_TextChanged(object sender, TextChangedEventArgs e)
        {
            var linesCount = CodeEditor.Text.Split('\n').Count();

            Lines = new ObservableCollection <int>(Enumerable.Range(1, linesCount));
            LineNumbers.ItemsSource = Lines;
            LineNumbers.ScrollIntoView(linesCount);
        }
예제 #2
0
 private void SynchroScroll(object sender, ScrollChangedEventArgs e)
 {
     if (sender == CodeEditor)
     {
         LineNumbers.ScrollIntoView(e.VerticalChange);
     }
     else
     {
         CodeEditor.ScrollToVerticalOffset(e.VerticalOffset);
     }
 }