Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Conversation

@krschau
Copy link
Collaborator

@krschau krschau commented Mar 7, 2024

Summary of the pull request

As more tools and extensions are created, the list of pages to configure in App.xaml.cs could grow quite long. Instead, allow tools to create extension methods for the IPageService, similar to what we do in ServiceExtensions today. This keeps clutter out of the configuration list, and allows tools to stay more contained (internal classes, etc).

References and relevant issues

Detailed description of the pull request / Additional comments

Validation steps performed

PR checklist

@krschau krschau changed the title User/krschau/sub pages Provide API for registering sub-pages Mar 7, 2024
@krschau krschau force-pushed the user/krschau/sub-pages branch from c5c74f5 to 5351615 Compare March 7, 2024 00:49
@krschau krschau changed the title Provide API for registering sub-pages Provide API for registering nested pages Mar 8, 2024
@krschau krschau mentioned this pull request Mar 11, 2024
3 tasks
@krschau krschau force-pushed the user/krschau/sub-pages branch from 5351615 to 68bd0ef Compare March 11, 2024 21:50
@krschau krschau force-pushed the user/krschau/sub-pages branch from 68bd0ef to 1ae2610 Compare March 11, 2024 21:51
@krschau krschau marked this pull request as ready for review March 12, 2024 17:51
* Dev Home widgets use the [Adaptive Card schema](https://adaptivecards.io/explorer/) version 1.5, which is the most recent schema supported by the WinUI 3 Adaptive Card renderer.
* There are [HostConfig](https://learn.microsoft.com/adaptive-cards/sdk/rendering-cards/uwp/host-config) files that define common styles (e.g., font family, font sizes, default spacing) and behaviors (e.g., max number of actions) for all the widgets. There is one for [light mode](../tools/Dashboard/DevHome.Dashboard/Assets/HostConfigLight.json) and one for [dark mode](../tools/Dashboard/DevHome.Dashboard/Assets/HostConfigDark.json).
* Dev Home supports a custom AdaptiveElement type called [`LabelGroup`](../common/Renderers/LabelGroup.cs). This allows a card author to render a set of labels, each with a specified background color. For an example of how to use this type, please see the [GitHub Issues widget](https://github.com/microsoft/devhomegithubextension/blob/main/src/GitHubExtension/Widgets/Templates/GitHubIssuesTemplate.json).
[Dashboard](./tools/Dashboard.md)
Copy link
Contributor

Choose a reason for hiding this comment

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

./tools/Dashboard.md

Would it make sense to keep the tool-specific documentation in the tool's project folder itself? I found this helpful with the Customization tool bring up because the md file will show up in Visual Studio to make it easier to reference, then we could just keep a link to those here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Keeping here for now, but might move things later. Still have some doc work upcoming.

Copy link
Contributor

@nieubank nieubank left a comment

Choose a reason for hiding this comment

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

:shipit:

{
Type GetPageType(string key);

public void Configure<T_VM, T_V>()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the T_?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think it's like Type_ViewModel and Type_View. I used the existing function definition and just moved it.

@krschau krschau merged commit 7845c1c into main Mar 18, 2024
@krschau krschau deleted the user/krschau/sub-pages branch March 18, 2024 15:10
nieubank added a commit that referenced this pull request Mar 18, 2024
- Update to incorporate #2356 for PageService sub-page registration

- Update nuget package based on conflicts with newly added C++ projects that require packages.config

- Remove breadcrumb until we figure out if there's going to be a common way to do this without duplicating so much code. The impact here is minimal since Customization doesn't have a ton of sub-pages (yet)

- Mark SettingsChanged telemetry event to be a measure, I'm guessing this doesn't need to be Critical?
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow tools to register sub pages with the PageService

4 participants