C # - check which event has been changed / available for a property

I have a class with say property

    private string fieldSelectedItem;
    public string FieldSelectedItem
    {
        get
        {
            return fieldSelectedItem;
        }
        set
        {
            fieldSelectedItem = value;
        }
    }

It is accessible from many places.

I came across a situation where an event has a class property in a class. and also some event changes value. I tried debugging. You can check which event / function has changed / accessed the property. is there any way to do this.

+3
source share
2 answers

How to place a breakpoint in the setter and look at the stack trace.

Simples.

+9
source

The stack trace should provide you with some information about where the call came from if you violate access to properties.

+4
source

Source: https://habr.com/ru/post/1784067/


All Articles