Some advise appreciated.
I have a form that I want to use for multiple purposes. i.e. List what has been ordered and amend what has been ordered.
I can display the form complete with all the items ordered without a problem. For this I do not want the item clicked to do anything as all I am doing is displaying
In my simple view (as the form was identical) I thought I would use a variable to control the item clicked event so I set a variable that I would check in the item clicked event, if it was true then I would have a little piece of code that would allow the modification, if it was false, it would ignore it as though Item clicked did nothing.
In page A, if edit button clicked I would set the variable to True await the navigation to B page and when it returned I would reset the variable to false. Seemed simple enough.
However, it didn't work. What I discovered was that when I awaited the page, it would run, display page B and then return execution to page A which would then reset the variable to false! In other word it didn't await until page B closed which was what I was expecting.
Now I could just have two pages, one for display and one of amendments, but that seems cumbersome as 95% of the code is identical.
Any suggestion for how I can reuse the same page/code?