• HOME
  • PRODUCTS
  • DEMOS
  • BUY
  • BLOG
  • FORUM
  • DOCUMENTATION
  • ABOUT
  • FREE EVALUATION
Search Results for

    Show / Hide Table of Contents

    Source Property

    Source

    Gets or sets an object that implements ITextSource interface containing an actual string data displayed by the control.

    Declaration
    public virtual ITextSource Source { get; set; }
    Property Value
    Type Description
    ITextSource
    Remarks

    Set this property to display text content from a different text source.

    Source object can be assigned to several TextEditor controls so that they can provide multiple views of the text.

    Examples

    Here is how to set a Source different TextSource from the C# code:

    public partial class MainWindow : Window
    {
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var textEditor1 = new Alternet.Editor.Wpf.TextEditor();
            var textEditor2 = new Alternet.Editor.Wpf.TextEditor();
            var textSource = new Alternet.Editor.Wpf.TextSource();
            textSource.LoadFile("myfile.txt");
            textEditor1.Source = this.textSource;
            textEditor2.Source = this.textSource;
        }
    }
    

    Here is how to set a Source different TextSource from the Visual Basic code:

    Partial Public Class MainWindow
        Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
            Dim textEditor1 = New Alternet.Editor.Wpf.TextEditor()
            Dim textEditor2 = New Alternet.Editor.Wpf.TextEditor()
            Dim textSource = New Alternet.Editor.Wpf.TextSource()
            textSource.LoadFile("myfile.txt")
            textEditor1.Source = Me.textSource
            textEditor2.Source = Me.textSource
        End Sub
    End Class
    
    In This Article
    Back to top Copyright AlterNET Software Download PDF