public CurrentHoveredTileCoordinateViewModel(ICurrentHoveredTileHolderGetRepository repository) { CoordinateLiveData = new LiveData <Coordinate?>(); _disposable = repository.GetObservableStream() .SubscribeOn(Scheduler.ThreadPool) .ObserveOn(Scheduler.MainThread) .Subscribe( holder => CoordinateLiveData.PostValue(holder != null ? holder.Value.Coordinate : (Coordinate?)null) ); }
public HoveredTileIndicatorViewModel(ICurrentHoveredTileHolderGetRepository hoveredTileHolderGetRepository, ICurrentSelectedTileHolderGetRepository selectedTileHolderGetRepository) { CurrentlyHoveredTileHolderLiveData = new LiveData <TileHolder>(); CurrentlySelectedTileHolderLiveData = new LiveData <TileHolder>(); _disposable = new CompositeDisposable { hoveredTileHolderGetRepository .GetObservableStream() .Subscribe(CurrentlyHoveredTileHolderLiveData.PostValue), selectedTileHolderGetRepository .GetObservableStream() .Subscribe(CurrentlySelectedTileHolderLiveData.PostValue) }; }