Skip to content

[Bug]: Mixing WPF and WinForms packages (ElementHosting WPF controls inside WinForms) breaks MainThreadScheduler (and possibly other things) #3886

Open
@Metadorius

Description

@Metadorius

Describe the bug 🐞

WaitForDispatcherScheduler silently breaks because apparently the dispatcher is either not created at all or not created before ElementHost appears. As a result all my .ObserveOn(RxApp.MainThreadScheduler) calls don't actually do anything.

Apparently there are also per-platform registrations that may clash, but I haven't observed the results yet.

Step to reproduce

  1. Install ReactiveUI.WinForms and ReactiveUI.WPF
  2. Create a WinForms app
  3. Try to use .ObserveOn(RxApp.MainThreadScheduler) to switch threads

Reproduction repository

No response

Expected behavior

All should happen as normal

Screenshots 🖼️

No response

IDE

No response

Operating system

No response

Version

No response

Device

No response

ReactiveUI Version

20.1.1

Additional information ℹ️

Using net48

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions