Skip to content

Remove async void usage from "How to Access the UI Thread" #485

Open
@stevemonaco

Description

@stevemonaco

How to Access the UI Thread

private async void OnTextFromAnotherThread(string text) is not an event handler.

The fire-and-forget in the ctor should probably be moved into Loaded so it can be awaited:
_ = Task.Run(() => OnTextFromAnotherThread("test"));

Docs should encourage safe patterns where possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions