public FeatureActiveMessageService()
 {
     Features.Instance.AfterFeatureActivate += AfterFeatureActivate;
     _activeMessagesFeature = Features.Instance.ActiveFeature as IMessagesFeature;
     if (_activeMessagesFeature != null)
         _activeMessagesFeature.ActiveMessagesChanged += Feature_ActiveMessagesChanged;
 }
 public FeatureActiveMessageService()
 {
     Features.Instance.AfterFeatureActivate += AfterFeatureActivate;
     _activeMessagesFeature = Features.Instance.ActiveFeature as IMessagesFeature;
     if (_activeMessagesFeature != null)
     {
         _activeMessagesFeature.ActiveMessagesChanged += Feature_ActiveMessagesChanged;
     }
 }
        private void AfterFeatureActivate(IFeature oldFeature, IFeature newFeature)
        {
            if (_activeMessagesFeature != null)
                _activeMessagesFeature.ActiveMessagesChanged -= Feature_ActiveMessagesChanged;

            _activeMessagesFeature = newFeature as IMessagesFeature;
            if (_activeMessagesFeature != null)
                _activeMessagesFeature.ActiveMessagesChanged += Feature_ActiveMessagesChanged;

            OnActiveMessagesChanged();
        }
        private void AfterFeatureActivate(IFeature oldFeature, IFeature newFeature)
        {
            if (_activeMessagesFeature != null)
            {
                _activeMessagesFeature.ActiveMessagesChanged -= Feature_ActiveMessagesChanged;
            }

            _activeMessagesFeature = newFeature as IMessagesFeature;
            if (_activeMessagesFeature != null)
            {
                _activeMessagesFeature.ActiveMessagesChanged += Feature_ActiveMessagesChanged;
            }

            OnActiveMessagesChanged();
        }