title: WPF: Appending Text from Model to ViewModel
body: <p>In my <em>MVVM project</em> i have a <em>Model Layer</em> that contains a class, lets call it <strong>ModelClass</strong>, this class does alot of calculating and logs every action to a <strong>LogViewer</strong>. The <strong>ModelClass</strong> also contains a <em>EventHandler</em>, <strong>LogEvent</strong>, thats get invoked every time the function <strong>Log(string text)</strong> is called. A StringBuilder is made with the <em>text</em> as starting string, the StringBuilder is then returned from the function and is sent as an argument with the <em>Event</em>.</p>
  <p>In my <em>View Model Layer</em> i have a class called <strong>LogViewerVM</strong>, this class has a Log function that is subscribed to the <strong>LogEvent</strong> in <strong>ModelClass</strong>. So when a log happens in the <em>Model Layer</em> the <em>View Model Layer</em> is notified and can update the GUI accordingly.
  Each new <strong>Log(StringBuilder str)</strong> call creates a new <strong>LogEntry</strong>, which is a <em>View Model Layer</em> class that contains the <em>StringBuilder</em> (this is the same StringBuilder created in <em>Model Layer</em>, same reference)</p>
  <p>In the <em>View Layer</em> i have a <strong>LogViewerV</strong> that draws the log with a <em>ListView</em> for each <strong>LogEntry</strong> in the <strong>LogViewerVM</strong>.</p>
  <p>So far so good, everything works as intended. However when calling <em>.Append</em> on a <em>StringBuilder</em> from <em>Model Layer</em> does not automatically notify the <em>View Layer</em> or the <em>Model View Layer</em>. My <em>Model Layer</em> has no awareness/references to the <em>View Layer</em> NOR the <em>View Model Layer</em>, so there is no way for me to update the bindings when calling <em>.Append</em>.</p>
  <p>So my question is; How should i solve this? I would like to be able to use <em>.Append</em> from the <em>Model Layer</em>, but im not sure how. I do know how i could restructure everything so that i do not need to use <em>.Append</em> from Model, however that would require me to change alot of stuff. So if there is a way i can <em>.Append</em> from <em>Model Layer</em> and have the <em>View Layer</em> respond to that, that would be great.</p>
  <p><strong>end of question</strong>
  i did not add any code because my question is general and not specific to my code. I also do not know what code would be relevant. All my question can be boiled down to is:
  &quot;How can the View layer be notified when the model layer has used .Append on a StringBuilder that is also referenced in the View Model layer and has a binding to the View layer&quot;</p>