canton7 / Stylet

A very lightweight but powerful ViewModel-First MVVM framework for WPF for .NET Framework and .NET Core, inspired by Caliburn.Micro.
MIT License
994 stars 143 forks source link

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

Closed kuangxj closed 3 months ago

kuangxj commented 10 months ago

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

Additional Info Add any other context about the problem here.

canton7 commented 10 months ago

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

kuangxj commented 10 months ago

I replied after trying.

canton7 commented 10 months ago

I'm not sure what you mean by that

kuangxj commented 3 months ago

I fix it,thanks.