canton7 / Stylet

A very lightweight but powerful ViewModel-First MVVM framework for WPF for .NET Framework and .NET Core, inspired by Caliburn.Micro.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I have a class ScreenEx that inherits from Screen, rewriting OnActivate in a new ViewModel that is unresponsive

kuangxj opened this issue · comments

Description
I have a class ScreenEx that inherits from Screen, rewriting OnActivate in a new ViewModel that is unresponsive

To Reproduce

class ScreenEx : Screen
{
    public string ContentId { get; set; } = Guid.NewGuid().ToString();
}

class TestViewModel:ScreenEx,IDisposable
{
  
    protected override void OnActivate()
    {
        // After F9 ,not work.
        base.OnActivate();
    }
    public void Dispose()
    {
        
    }
}

Version Info

  • Stylet version: [e.g. 1.2.3]
  • Runtime version: [e.g. 5.0.300]

Additional Info
Add any other context about the problem here.

I tried to reproduce the problem using your code, but it worked fine.

I replied after trying.

I'm not sure what you mean by that

I fix it,thanks.