Bind WPF TextBlock to text file

前端 未结 3 1653
执笔经年
执笔经年 2021-01-23 17:05

How can I bind a WPF TextBlock to a text file? I want for the TextBlock to display the content of the file.

3条回答
  •  无人及你
    2021-01-23 17:29

    If you want the text to be formatted my inline markup you could look at the sub-class of TextBlock I made here. There is a convertor between a String of xaml markup and an InlineCollection(actually a generic list of Inlines) too.

提交回复
热议问题