dotnet / dotnet/project-system

New Property Pages: Implement OnSetPropertyValueAsync but for evaluated values

Open
#7,507 0 comments 0 reactions 0 assignees View on GitHub
Feature-Project-Properties-Designer Triage-Investigate
Dominant language
C#
Stars
1k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

Currently, we can use the `IInterceptingPropertyValueProvider` to do custom logic for properties on the property pages. There is a method, `OnSetPropertyValueAsync`, which allows you to set the property in a custom way. This method uses the unevaluated value to perform an action on the property. However, there are situations where custom property set actions require the *evaluated* value. For example, the [PR I made for ApplicationIcon](https://github.com/dotnet/project-system/pull/7461) requires that the file on disk is copied. Therefore, the value provided by the user needs to be a filepath. If someone provides an MSBuild variable, the value may be a valid filepath, but we don't know since it isn't evaluated yet. Many properties that use `IInterceptingPropertyValueProvider` would likely need this logic too; to have the evaluated value of the property before it makes a determination if that property is valid or needs to perform a certain action.

Note: I don't know if this is possible since I don't know the full pipeline for updating and setting the properties. But currently, this causes odd behavior for the user since the user can put valid values into the csproj file for a property, but in certain situations (like ApplicationIcon), we have to restrict the values they can enter into the property page UI.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.