Created
June 6, 2020 10:22
-
-
Save ScottBurfieldMills/a83b5b40f57c1558dbd5a8bc5ae697c3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@using CastCompare.Data | |
@using CastCompare.Pages | |
@inject ITvDbService TvDbService | |
<div class="row"> | |
<div class="col-md-2"> | |
<BlazoredTypeahead SearchMethod="@SearchShows" | |
@bind-Values="@SelectedTvShows" | |
Placeholder="Search for a TV show" | |
MinimumLength="3" | |
Debounce="200"> | |
<SelectedTemplate Context="series"> | |
<img src="@series.Banner" width="50" alt="@series.Banner" /> | |
@series.Title | |
</SelectedTemplate> | |
<ResultTemplate Context="series"> | |
<img src="@series.Banner" width="50" alt="@series.Banner" /> | |
@series.Title | |
</ResultTemplate> | |
<NotFoundTemplate> | |
None found | |
</NotFoundTemplate> | |
</BlazoredTypeahead> | |
</div> | |
</div> | |
@code { | |
[Parameter] | |
public IList<TvSearchResult> SelectedTvShows { get; set; } | |
private async Task<IEnumerable<TvSearchResult>> SearchShows(string searchText) | |
{ | |
var results = await TvDbService.SearchAsync(searchText); | |
return results; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment