Skip to content

ViewModel WhenActivated is not called (resp. Compiler error CS0121 "Ambiguous call") #3504

Closed Answered by ChrisPulman
adaxer asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @adaxer,
Firstly you need to target windows 10.0.17763.0 + to use the latest ReactiveUI due to compatibility with other dependencies, please change to the following minimum version or above.
net6.0-windows10.0.17763.0

Please update your viewmodel as follows, the way in which you initialised your property will return a new activator every time.
Once you have done this you should be up and running.

public class MainViewModel : ReactiveObject, IActivatableViewModel
{
    public MainViewModel()
    {
        Activator = new ViewModelActivator();
        this.WhenActivated((CompositeDisposable d) =>
        {
            Console.WriteLine("WhenActivated");
        });
        this.WhenActiv…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@adaxer
Comment options

Answer selected by ChrisPulman
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants