I've got the following problem:
I want to replace a hardcoded string which contains a property name with a LINQ member expression
// like this:
NotifyOfPropertyChange("MyProperty");
// becomes
NotifyOfPropertyChange(() => MyProperty);
with a ReSharper pattern.
The following attempts didn't work:
NotifyOfPropertyChange("$prop$"); // ($prop$ is of type Identifier, results in parse error)
NotifyOfPropertyChange($prop$); // ($prop$ is of type Expression [System.String],
// almost works, but without removing the quotes
The replace pattern was always the same:
NotifyOfPropertyChange(() => $prop$);
Any ideas?
If I understand your intention correctly then this maybe will help. Some time ago I found this piece of code ( can't remember who posted it originally)
So the following:
should give a result: