In a Console application you can use "Console.WriteLine" to log an event, in WPF you can do the same using a RichTextBox code behind something like this :
public Logger(RichTextBox loggingRichTextBox)
{
_content = new FlowDocument();
LoggingRichTextBox = loggingRichTextBox;
LoggingRichTextBox.Document = _content;
}
I can't figure out how to do this with MVVM as you can't pass the RichTextBox control to the ViewModel?
Anyone has a example? Is it even possible or is there a better way?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…