diff --git a/Stylet/ConductorAllActive.cs b/Stylet/ConductorAllActive.cs index 3aea8db..c80a27d 100644 --- a/Stylet/ConductorAllActive.cs +++ b/Stylet/ConductorAllActive.cs @@ -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()) - { - 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); } /// diff --git a/Stylet/ConductorBaseWithActiveItem.cs b/Stylet/ConductorBaseWithActiveItem.cs index 8640808..ee53a68 100644 --- a/Stylet/ConductorBaseWithActiveItem.cs +++ b/Stylet/ConductorBaseWithActiveItem.cs @@ -46,6 +46,8 @@ namespace Stylet if (this.IsActive) ScreenExtensions.TryActivate(newItem); + else + ScreenExtensions.TryDeactivate(newItem); } this._activeItem = newItem;