/ / Agregatory zdarzeń nie publikują w Prism 7.0 dla formularzy Xamarin - xamarin.forms, eventaggregator, prism-7

Event Aggregators nie publikuje w Prism 7.0 dla Xamarin Forms - xamarin.forms, eventaggregator, prism-7

Niedawno zaktualizowałem moje formularze Xamarinprojekt aplikacji od Prism 6.3 do Prism 7.0. Wydaje się, że wszystko działa dobrze, z wyjątkiem agregatorów zdarzeń, które są poprawnie subskrybowane, ale nie wydają się być publikowane.

Oto część mojego kodu

public ConfigureInventoryEventViewModel(IEventAggregator ea, INavigationService navigationService):base(navigationService,ea)

{
TappedBackCommand = new DelegateCommand(TappedBack);

_ea.GetEvent<SetLocationEvent>().Subscribe(SetLocationDropdown,true);
}

Wydarzenie publikuję ze strony modalnej

public ModalPopupViewModel(IEventAggregator ea, INavigationService
navigationService):base(navigationService,ea)
{
ItemTappedCommand = new DelegateCommand<string>(ItemTapped);
}



private void ItemTapped(string strItem)
{
_ea.GetEvent<SetLocationEvent>().Publish();
}

Klasa wydarzenia:

public class SetLocationEvent:PubSubEvent
{
}

Proszę pomóż.

Wersja Xamarin Forms: 2.5.0.280555 Prism.forms: 7.0.0396

Dzięki

Odpowiedzi:

0 dla odpowiedzi № 1

Myślę, że o tym zapomniałeś: _ea = ea

public ConfigureInventoryEventViewModel(IEventAggregator ea, INavigationService navigationService):base(navigationService,ea)
{
_ea = ea;

TappedBackCommand = new DelegateCommand(TappedBack);
_ea.GetEvent<SetLocationEvent>().Subscribe(SetLocationDropdown,true);
}

public ModalPopupViewModel(IEventAggregator ea, INavigationService navigationService):base(navigationService,ea)
{
_ea = ea;

ItemTappedCommand = new DelegateCommand<string>(ItemTapped);
}