mirror of https://github.com/AMT-Cheif/Stylet.git
If a conductor receives a new ActiveItem, and it's not active, it will deactivate that item
This is needed because the item being activated might actually be in the closed state, and we'll need to bring it into the deactive state
This commit is contained in:
parent
20c708ddbe
commit
c0562205de
|
@ -79,12 +79,12 @@ namespace Stylet
|
|||
protected virtual void ActivateAndSetParent(IEnumerable items)
|
||||
{
|
||||
this.SetParent(items);
|
||||
if (this.IsActive)
|
||||
foreach (var item in items)
|
||||
{
|
||||
foreach (var item in items.OfType<IActivate>())
|
||||
{
|
||||
item.Activate();
|
||||
}
|
||||
if (this.IsActive)
|
||||
ScreenExtensions.TryActivate(item);
|
||||
else
|
||||
ScreenExtensions.TryDeactivate(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,6 +144,8 @@ namespace Stylet
|
|||
|
||||
if (this.IsActive)
|
||||
ScreenExtensions.TryActivate(item);
|
||||
else
|
||||
ScreenExtensions.TryDeactivate(item);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -46,6 +46,8 @@ namespace Stylet
|
|||
|
||||
if (this.IsActive)
|
||||
ScreenExtensions.TryActivate(newItem);
|
||||
else
|
||||
ScreenExtensions.TryDeactivate(newItem);
|
||||
}
|
||||
|
||||
this._activeItem = newItem;
|
||||
|
|
Loading…
Reference in New Issue