Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a basic HOW TO on adding a new property page #7140

Merged
merged 6 commits into from
Apr 23, 2021

Conversation

tmeschter
Copy link
Contributor

@tmeschter tmeschter commented Apr 21, 2021

Adds documentation going through the basic steps of creating a new property page. Much of this is covered in the existing property-specification.md file, but I felt the need for something a bit more guided.

I plan to fill out the second option (embedding the XAML file) in a subsequent change; I started writing that section and then realized I didn't actually know enough of the details. :-)

I also plan to write similar HOW TOs for adding a launch profile, extending an existing property page or launch profile, localization, and other common operations.

Microsoft Reviewers: Open in CodeFlow

Stub out a new Markdown file that will describe how to add a new property page, and link to it from the README.md.
Fill out the steps for defining a new property page.
@tmeschter tmeschter added the Feature-Project-Properties-Designer The new project property pages which replace the legacy AppDesigner label Apr 21, 2021
@tmeschter tmeschter requested a review from a team as a code owner April 21, 2021 22:45
Comment on lines +21 to +23
<None Update="MyPropertyPage.xaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For SDK-style, this style is preferred:

Suggested change
<None Update="MyPropertyPage.xaml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="MyPropertyPage.xaml" CopyToOutputDirectory="PreserveNewest" />

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it's better supported in SDK-style projects, but it's hard to call it preferred. If you update the property of a file through the Properties window (e.g. set "Copy to Output Directory" to "Copy if newer") we won't use the attribute style, even for SDK-style projects.

The only place it's really common right now is PackageReference.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, a few years back, I migrated a bunch of projects from csproj-style to SDK-style. And, at that time, I found documentation on the format with a decent migration guide. Right now, I just spent some time searching, and literally everything I found from the past is no longer there. No idea where it went, but the internet has lost information as it does over time. However, I can find remnants of why I said this is 'preferred':

I can find answers, posts, questions, issues, etc. showing it being used as an attribute versus a node. But, I honestly cannot find the source of behind it. I would not take the actions of VS to be an 'absolute' on the format. But, I do know there had been information on what should be used as attributes versus nodes. I just can't find it anymore. 😭

tmeschter and others added 4 commits April 22, 2021 10:18
Move the "How-To Guides" into the "Customising Project Properties" section, and move that section ahead of "Architecture" as it is likely the more relevant for most readers.
Co-authored-by: Drew Noakes <git@drewnoakes.com>
Rearrange text so all project file manipulation happens in subsequent steps.
@tmeschter tmeschter merged commit 20143b0 into dotnet:main Apr 23, 2021
@ghost ghost added this to the 16.10 milestone Apr 23, 2021
@tmeschter tmeschter deleted the 210421-HowToDefineAPropertyPage branch April 23, 2021 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature-Project-Properties-Designer The new project property pages which replace the legacy AppDesigner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants