4,152 questions
issue in OnAppearing() when calling async method, in realse mode , working fine in debug mode
Ashutosh Mehere
0
Reputation points
//exception UserProfileData is null in resale mode , working fine in debug mode
protected override async void OnAppearing()
{
try
{
base.OnAppearing();
UserProfileData ??= new UserProfileData();
if (UserProfileData.IsDataLoaded)
return;
IndicatorHome.IsVisible = true;
HomePageContent.IsEnabled = false;
UserProfileData = await _homeService.GetUserDetails();
LabelUserName.Text = UserProfileData.Name;
UserProfile.ImageSource = UserProfileData.ImageSource;
DashBoardResponse = await _homeService.GetHomeScreenInfoAsync();
RecentTransactionList.ItemsSource = await _homeService.GetRecentTransactionsTaskAsync();
UserProfileData.IsDataLoaded = true;
BindingContext = DashBoardResponse;
IndicatorHome.IsVisible = false;
HomePageContent.IsEnabled = true;
}
catch (Exception ex)
{
await DisplayAlert("Exception raised Home appearing",
UserProfileData == null ? "UserProfileData is null" : ex.ToString(), "OK");
}
``` }
Developer technologies .NET .NET MAUI
Sign in to answer