@page "/now" @using Selector.SignalR; @using System.Linq; @implements IDisposable

Now

@if (nowCache.LastPlayCount?.AlbumCountData?.Count() > 3) {
} @if (nowCache.LastPlayCount?.TrackCountData?.Count() > 3) {

Track History

} @if (nowCache.LastPlayCount?.AlbumCountData?.Count() > 3) {

Album History

} @if (nowCache.LastPlayCount?.ArtistCountData?.Count() > 3) {

Artist History

}
@code { [Inject] private NowHubCache nowCache { get; set; } private bool smooth = true; private bool showDataLabels = false; private double strokeWidth = 5; protected override void OnInitialized() { nowCache.NewNowPlaying += OnNewPlaying; nowCache.NewCard += OnNewCard; nowCache.NewPlayCount += OnNewPlayCount; nowCache.NewAudioFeature += OnNewAudioFeature; } private void OnNewPlaying(object sender, EventArgs args) { Update(); } private void OnNewCard(object sender, EventArgs args) { Update(); } private void OnNewPlayCount(object sender, EventArgs args) { Update(); } private void OnNewAudioFeature(object sender, EventArgs args) { Update(); } public void Update() { Application.Current.Dispatcher.Dispatch(() => { StateHasChanged(); }); } public void Dispose() { nowCache.NewNowPlaying -= OnNewPlaying; nowCache.NewCard -= OnNewCard; nowCache.NewPlayCount -= OnNewPlayCount; nowCache.NewAudioFeature -= OnNewAudioFeature; } }