Update "propdp" snippet to use nameof #44551
Labels
Area-IDE
Blocked
Concept-Continuous Improvement
Developer Community
The issue was originally reported on https://developercommunity.visualstudio.com
IDE-CodeStyle
Built-in analyzers, fixes, and refactorings
Milestone
This issue has been moved from a ticket on Developer Community.
The
propdp
C# code snippet creates the following code:Notice the
"MyProperty"
string literal, which points to the backing property for the dependency property. This is not ideal, because renaming the property will not change this string and will cause unexpected problems at runtime. Instead, the code snippet could generate the following:Using the
nameof
operator, the code would gain compile time safety and would automatically update the reference whenever the property name changes.Original Comments
Visual Studio Feedback System on 5/25/2020, 03:06 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Original Solutions
(no solutions)
The text was updated successfully, but these errors were encountered: