title: Determine if a property value is set by user (i.e. binding)
body: <p><strong>Preamble:</strong> I am making a logging tool for our company needs. We use MVVM - pattern in our projects via Caliburn. At this moment my tool is capable of weaving compiled code via Mono.Cecil assembly and injecting call of a logging method in public properties set methods.</p>
  
  <p><strong>Fabula:</strong> Let's say, I have a class <code>Person</code></p>
  
  <pre><code> public class Person
      {
          public string Name
          {
              get { return _name; }
              set
              {
                   Logger.MyLogMethod(_name, value, "Person");
                  _name = value;
              }
          }
          private string _name;
      }
  </code></pre>
  
  <p>and a class <code>Logger</code></p>
  
  <pre><code>public static class Logger
      {
          public static void MyLogMethod(string oldvalue, string newvalue, string propertyname)
          {
          //condition to log only user changes
          }
      }
  </code></pre>
  
  <p>And an instance of a person has its Name property binded to textbox</p>
  
  <pre><code>   &lt;TextBox Text="{Binding SelectedPerson.Name}"/&gt;
  </code></pre>
  
  <p>And we have a button, which click calls a code, which will set new value to SelectedPerson.</p>
  
  <p>So, we have two ways of setting our Person's Name property at a runtime. It's either by user typing in textbox, or a user clicking a button, therefore calling some code.</p>
  
  <p><em>I would like to know</em>: how to distinct these two cases. In other words - when a set method of a property is called - how to determine, if it was called by binding engine or by <em>our</em> code.</p>
  
  <p>So far I have one approach that is doable in my opinion - to take a look at StackTrace. Not sure how to do it thought.</p>