You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Avalonia, their ViewModelViewHost correctly sets the datacontext for a view to the wired view model. In WPF, the default ViewModelViewHost implementation does not do this, you are forced to manually set the DataContext after view activation. I suspect this is because the generic design of the ViewModelHost to allow it to work for various UI frameworks, because there is no code within to do this.
Step to reproduce
Create a WPF app with a ViewModelViewHost with ViewModel set to a viewmodel with a view declared.
We don't set the DataContext by design. Rxui does not require it if you do rxui binding. The user can set the datacontext if they want with the rxui binding.
Describe the bug 🐞
In Avalonia, their ViewModelViewHost correctly sets the datacontext for a view to the wired view model. In WPF, the default ViewModelViewHost implementation does not do this, you are forced to manually set the DataContext after view activation. I suspect this is because the generic design of the ViewModelHost to allow it to work for various UI frameworks, because there is no code within to do this.
Step to reproduce
Reproduction repository
https://github.com/reactiveui/ReactiveUI
Expected behavior
Using the ViewModelViewHost, should both render my view and bindings should work.
Screenshots 🖼️
No response
IDE
Rider Windows
Operating system
Windows
Version
11
Device
PC
ReactiveUI Version
19.5.39
Additional information ℹ️
No response
The text was updated successfully, but these errors were encountered: