-
Notifications
You must be signed in to change notification settings - Fork 14
Issue with Winforms and MAUI.NET
Bartłomiej Buchała edited this page Feb 26, 2023
·
1 revision
There have been reports about using Jikan.Net with Winforms. For example, a code below should be executed during loading Form:
private void Form1_Load(object sender, EventArgs e)
{
IJikan jikan = new Jikan();
var animeTest = jikan.GetAnimeAsync(1).Result;
this.label1.Text = animeTest.Title;
}
But for some reason, the IDE just hangs and no form is loaded... No error or warning either.
The catch is, Winforms is not so great with async methods, even when you use .Result
to get data from Jikan.Net requests. The solution is to use async methods for Winforms events.
Changed code:
private async void Form1_Load(object sender, EventArgs e)
{
IJikan jikan = new Jikan();
var animeTest = await jikan.GetAnimeAsync(1);
this.label1.Text = animeTest.Title;
}
Our label in form will now display "Cowboy Bebop" shortly after loading.
Very similar case has been reported for .NET MAUI platform
- GetAnimeAsync
- GetAnimeEpisodesAsync
- GetAnimeCharactersAsync
- GetAnimeStaffAsync
- GetAnimeForumTopicsAsync
- GetAnimeMoreInfoAsync
- GetAnimeNewsAsync
- GetAnimePicturesAsync
- GetAnimeRecommendationsAsync
- GetAnimeReviewsAsync
- GetAnimeStatisticsAsync
- GetAnimeUserUpdatesAsync
- GetAnimeVideosAsync
- GetMangaAsync
- GetMangaCharactersAsync
- GetMangaForumTopicsAsync
- GetMangaMoreInfoAsync
- GetMangaNewsAsync
- GetMangaPicturesAsync
- GetMangaRecommendationsAsync
- GetMangaReviews
- GetMangaStatistics
- GetMangaUserUpdates
- Jikan
- BaseJikanRequest
- Anime
- AnimeCharactersStaff
- AnimeEpisodes
- AnimeGenre
- AnimeNews
- AnimePictures
- AnimeReviews
- AnimeStats
- AnimeTop
- AnimeUserUpdates
- AnimeVideos
- Character
- CharacterPictures
- CharactersTop
- Club
- ClubMembers
- ForumTopics
- Magazine
- Manga
- MangaCharacters
- MangaGenre
- MangaNews
- MangaPictures
- MangaReviews
- MangaStats
- MangaTop
- MangaUserUpdates
- MoreInfo
- PeopleTop
- Person
- Producer
- Recommendations
- Schedule
- Season
- SeasonArchives
- StatusMetadata
- UserAnimeList
- UserFriends
- UserHistory
- UserMangaList
- UserProfile
- AnimeEpisode
- AnimeListEntry
- AnimeReview
- AnimeReviewer
- AnimeReviewScores
- AnimeStaffPosition
- AnimeSubEntry
- AnimeTopEntry
- AnimeUserUpdate
- CharacterEntry
- CharacterTopEntry
- ClubMember
- EpisodeVideo
- ForumPostSnippet
- Friend
- ForumTopic
- HistoryEntry
- Licensor
- MALImageSubItem
- MALSubItem
- MangaListEntry
- MangaReview
- MangaReviewer
- MangaReviewScores
- MangaSubEntry
- MangaTopEntry
- MangaUserUpdate
- News
- PersonTopEntry
- Picture
- PromoVideo
- PublishedManga
- Recommendation
- Review
- Reviewer
- RelatedAnime
- RelatedManga
- ScoringStatEntry
- ScoringStats
- SeasonArchive
- StaffPositionEntry
- TimePeriod
- UserAnimeStatistics
- UserFavoritesSection
- UserFavoritesSection
- UserUpdate
- VoiceActingRole
- VoiceActorEntry
- AnimeSearchConfig
- AnimeSearchEntry
- AnimeSearchResult
- CharacterSearchEntry
- CharacterSearchResult
- MangaSearchConfig
- MangaSearchEntry
- MangaSearchResult
- PersonSearchEntry
- PersonSearchResult
- AgeRating
- Status
- AnimeExtension
- AnimeGenreSearch
- AnimeType
- CharacterExtension
- ClubExtensions
- MangaExtension
- MangaGenreSearch
- MangaType
- PersonExtension
- ScheduledDay
- SeasonExtension
- Seasons
- TopAnimeExtension
- TopMangaExtension
- UserAnimeListExtension
- UserExtension
- UserHistoryExtension
- UserMangaListExtension