I have a class that implements PropertyChanged. I do something similar to this to subscribe to it:
p.PropertyChanged += (s, a) => {
switch ( a.PropertyName) {
...
}
}
How can I later unsubscribe the above code from the p.PropertyChanged
?
Equivalent of (which clearly won't work):
p.PropertyChanged -= (s, a) => {
switch ( a.PropertyName) {
...
}
}
You must put it in a variable:
From the docs: