mirror of https://github.com/AMT-Cheif/Stylet.git
Allow initial activate after a close
This commit is contained in:
parent
c3d5cbcbe4
commit
3a6e82557a
|
@ -184,6 +184,8 @@ namespace Stylet
|
|||
((IScreenState)this).Deactivate();
|
||||
|
||||
this.View = null;
|
||||
// Reset, so we can initially activate again
|
||||
this.haveActivated = false;
|
||||
|
||||
this.SetState(ScreenState.Closed, (oldState, newState) =>
|
||||
{
|
||||
|
|
|
@ -424,5 +424,15 @@ namespace StyletUnitTests
|
|||
((IScreenState)this.screen).Activate();
|
||||
Assert.True(this.screen.OnInitialActivateCalled);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ClosingResetsInitialActivate()
|
||||
{
|
||||
((IScreenState)this.screen).Activate();
|
||||
this.screen.OnInitialActivateCalled = false;
|
||||
((IScreenState)this.screen).Close();
|
||||
((IScreenState)this.screen).Activate();
|
||||
Assert.True(this.screen.OnInitialActivateCalled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue