-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Description
I would love to have the DispatcherExtensions to be exposed so they are available outside Maui as well. There are a few very useful extension methods DispatchIfRequired() and FindDispatcher() that are useful for every Maui project. Also that EnsureDispatcher() is called in these methods is very helpful. Unfortunately these extension methods are internal. If this could be made public, a lot of Maui developers would be happy with this 😄
Public API Changes
// easily find dispatcher from every BindableObject
Grid grid = new();
var dispatcher = grid.FindDispatcher();
// only dispatch when required in one call (instead of first checking dispatcher.IsRequired and then calling dispatcher.Dispatch())
dispatcher.DispatchIfRequired(() => /* do something */);Intended Use-Case
The FindDispatcher() and DispatchIfRequired() are very useful and the EnsureDispatcher() logic that is built within these methods are making sure that the dispatcher is found properly. For every project these logic is re-created over and over, but it is already inside Maui itself! Only not available outside Maui...
Metadata
Metadata
Assignees
Labels
Type
Projects
Status