Skip to content

Commit

Permalink
analyzer doc tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
dotMorten committed Sep 23, 2023
1 parent e17d149 commit f472f9c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions docs/rules/WinUIEx1002.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## WinUIEX1002: The member will always be null.
## WinUIEX1002: Dispatcher must be replaced with DispatcherQueue.

The Dispatcher will always return null. It has been replaced by the DispatcherQueue. This API was there due to UWP API surface area requirements, but is not used in WinUI, and has been replaced by the DispatcherQueue.
The Dispatcher will always return null, and has been replaced by the DispatcherQueue. This API was there due to UWP API surface area requirements, but is not used in WinUI, and has been replaced by the DispatcherQueue.

|Item|Value|
|-|-|
Expand All @@ -16,13 +16,14 @@ To address this, change your use of `Dispatcher` from:
```cs
Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
{

// your code
});
```
to:
```cs
DispatcherQueue.TryEnqueue(Microsoft.UI.Dispatching.DispatcherQueuePriority.Normal, () =>
{
// your code
});
```

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/WinUIEx.Analyzers/WinUIEx.Analyzers/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,6 @@
<value>The member '{0}' will always be null and should not be used. Instead use '{1}'.</value>
</data>
<data name="DispatcherTitle" xml:space="preserve">
<value>Dispatcher is not available in WinUI 3</value>
<value>Dispatcher must be replaced with DispatcherQueue</value>
</data>
</root>

0 comments on commit f472f9c

Please sign in to comment.