0

I tried to register to the MessageBus an observable that replay the last value produced when a new subscription occurs

var currentViewObs = currentViewGallery.ObservableForProperty(g => g.SelectedIndex)
                .Value().Select(CurrentViewObsSelector).Replay(1);

currentViewObs.Connect();

MessageBus.Current.RegisterMessageSource(currentViewObs, MessageBusContracts.CurrentView);

This doesn't work because the observable is wrapped in a ScheduledSubject which swallows the replay. Is there another way of doing that?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Dtex
  • 2,593
  • 1
  • 16
  • 17

1 Answers1

1

In this case, you probably want to use your own MessageBus - implement IMessageBus (possibly by just copy-pasting code from here and editing it), then assign it to MessageBus.Current

Ana Betts
  • 73,868
  • 16
  • 141
  • 209