Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customer View Details does not correctly show the detail information #16

Closed
cairoutm opened this issue Mar 26, 2020 · 2 comments
Closed

Comments

@cairoutm
Copy link

Hi;

When I run the application and click detail on customer, the program always show "Kelly She" information doesn't matter the customer I clicked. Please fixed it.

Thanks

@ethvedbitdesjan
Copy link

ethvedbitdesjan commented Aug 1, 2021

Hi,

I have a workaround for the bug. I do not know the exact cause of the problem but the following was my workaround and it worked:

In the file: CustomerDetailPage.xaml.cs
In the function: OnNavigatedTo
After the if else statement:
Add:

ViewModel.AddNewCustomerCanceled += AddNewCustomerCanceled;
EmailText.Text = string.IsNullOrEmpty(ViewModel.Email) ? "Null" : ViewModel.Email;

Do this for each textbox and parameter and it works.

Another way of doing the same thing would be to add in the above mentioned place:

ViewModel.AddNewCustomerCanceled += AddNewCustomerCanceled;
EmailText.Text = ViewModel.Email;

And also add some code in the CustomerViewModel.cs:
In the public string definitions of the class atributes(for example FirstName or Email):
Change their get functions to:
get => string.IsNullOrEmpty(Model.Email) ? "Null" : Model.Email;

Once again you have to change the line in every attribute.

If the above works, can the issue be closed?

@jwmsft
Copy link
Member

jwmsft commented Aug 9, 2021

Sorry for the delayed response to this issue. We've just released a bunch of updates for this sample, including a fix for this bug. The solution is just that the NavigationCacheMode for the CustomerDetail page should be set to Disabled so the customer data isn't cached. See this commit for the fix: 423b80b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants