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

Fix DispatcherQueueTimerExtensions example #688

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

enitimeago
Copy link
Contributor

@enitimeago enitimeago commented Apr 2, 2023

What changes to the docs does this PR provide?

This PR fixes the example documentation for DispatcherQueueTimerExtensions, which incorrectly attempts to demonstrate creating a DispatcherQueueTimer with new DispatcherQueueTimer().

DispatcherQueueTimer does not have such a public constructor.

The fix rewrites the example to create a DispatcherQueueTimer following https://github.com/MicrosoftDocs/winapps-winrt-api/blob/4a912fdbae00a0594556d2a3fbb9f721469b4bfe/microsoft.ui.dispatching/dispatcherqueuetimer.md#-examples. Revised, the below option is more concise.

The fix rewrites the example to create a DispatcherQueueTimer following the docs for Microsoft.Toolkit.Uwp.UI.DispatcherQueueTimerExtensions, which are also correct in the case of WinUI 3:

private DispatcherQueueTimer _typeTimer = DispatcherQueue.GetForCurrentThread().CreateTimer();

(The only notable difference is that while in UWP the class used is Windows.System.DispatcherQueueTimer and in WinUI 3 the class used is Microsoft.UI.Dispatching.DispatcherQueueTimer, the timer creation process is the same for both.)

PR Checklist

Please check if your PR fulfills the following requirements:

  • Correctly picked the right branch to base the change off (dev for new features, main for typos/improvements)
  • For new pages, used the provided template
  • For new features, added an entry in the Table of Contents
  • Ran against a spell and grammar checker
  • Contains NO breaking changes

Other information

DispatcherQueueTimer does not have a public constructor. Update example to show how to create a DispatcherQueueTimer instance similar to https://github.com/MicrosoftDocs/winapps-winrt-api/blob/4a912fdbae00a0594556d2a3fbb9f721469b4bfe/microsoft.ui.dispatching/dispatcherqueuetimer.md#-examples.
@learn-build-service-prod
Copy link
Contributor

Learn Build status updates of commit 8cb933a:

⚠️ Validation status: warnings

File Status Preview URL Details
docs/docfx.json ⚠️Warning Details
dotnet/docfx.json ⚠️Warning Details
dotnet/xml/CommunityToolkit.WinUI.UI/DispatcherQueueTimerExtensions.xml ⚠️Warning View Details

docs/docfx.json

  • Line 36, Column 50: [Warning: ms-prod-technology-invalid - See documentation] Invalid value for 'ms.technology': 'windows-community-toolkit' is not valid with 'ms.prod' value 'dotnet-communitytoolkit'.

dotnet/docfx.json

  • Line 54, Column 50: [Warning: ms-prod-technology-invalid - See documentation] Invalid value for 'ms.technology': 'windows-community-toolkit' is not valid with 'ms.prod' value 'dotnet-communitytoolkit'.

dotnet/xml/CommunityToolkit.WinUI.UI/DispatcherQueueTimerExtensions.xml

  • Line 0, Column 0: [Warning: xref-not-found] Cross reference not found: 'Microsoft.UI.Dispatching.DispatcherQueueTimer'.
  • Line 0, Column 0: [Warning: xref-not-found] Cross reference not found: 'Microsoft.UI.Dispatching.DispatcherQueueTimer'.

For more details, please refer to the build report.

If you see build warnings/errors with permission issues, it might be due to single sign-on (SSO) enabled on Microsoft's GitHub organizations. Please follow instructions here to re-authorize your GitHub account to Learn Build.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

@learn-build-service-prod
Copy link
Contributor

Learn Build status updates of commit ba72adb:

⚠️ Validation status: warnings

File Status Preview URL Details
docs/docfx.json ⚠️Warning Details
dotnet/docfx.json ⚠️Warning Details
dotnet/xml/CommunityToolkit.WinUI.UI/DispatcherQueueTimerExtensions.xml ⚠️Warning View Details

docs/docfx.json

  • Line 36, Column 50: [Warning: ms-prod-technology-invalid - See documentation] Invalid value for 'ms.technology': 'windows-community-toolkit' is not valid with 'ms.prod' value 'dotnet-communitytoolkit'.

dotnet/docfx.json

  • Line 54, Column 50: [Warning: ms-prod-technology-invalid - See documentation] Invalid value for 'ms.technology': 'windows-community-toolkit' is not valid with 'ms.prod' value 'dotnet-communitytoolkit'.

dotnet/xml/CommunityToolkit.WinUI.UI/DispatcherQueueTimerExtensions.xml

  • Line 0, Column 0: [Warning: xref-not-found] Cross reference not found: 'Microsoft.UI.Dispatching.DispatcherQueueTimer'.
  • Line 0, Column 0: [Warning: xref-not-found] Cross reference not found: 'Microsoft.UI.Dispatching.DispatcherQueueTimer'.

For more details, please refer to the build report.

If you see build warnings/errors with permission issues, it might be due to single sign-on (SSO) enabled on Microsoft's GitHub organizations. Please follow instructions here to re-authorize your GitHub account to Learn Build.

Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.

For any questions, please:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant