test return value after executing NavigateToAsync command

tim 200 Reputation points
2025-01-11T21:01:01.0633333+00:00

The following code works perfectly. but now I want to test the value returned in a global variable. (this is an inventory system with a multi column checklist page that calls and populates the infopagemodel when I tap an item/line , so that I can change and save the record )

  OnEditCommand = new Command(OnEditCommandAction);
 public async void OnEditCommandAction(object SelectedObj)
         {
             FilterList filterList = SelectedObj as FilterList;
             var navService = PageModelLocator.Resolve<NavigationService>();
             await navService.NavigateToAsync<InfoPageModel>(filterList, false);
             return;
         }

I need to run the following or something like it after returning from InfoPageModel so that I can change the background color of the line that I just saved.

 // global class
 namespace app.Resource
 {
     class Global
     {
         public static bool SaveOK = false;
     }
 }
 //cs code
 // if record saved set SaveOK to True and return from infopage  then check .
 Task task = CheckSaveStatue();
 public static async Task CheckSaveStatue()
 {  
 if Resource.Global.SaveOK then backgroundcolor = ..
 or
 _saveOK  = Resource.Global.SaveOK ;  
 if _saveOK then  backgroundcolor = ..
 }

I tried to trace the code and I cant find where the app go to,

it executes the navService then Return; then it opens the infopageModel then the cursor is no longer visible afterwards

TIA

Tim

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,857 questions
{count} votes

1 answer

Sort by: Most helpful
  1. tim 200 Reputation points
    2025-01-14T15:21:39.0666667+00:00

    I'm going to close this post, I'm not happy with the way this app is turning out.

    I'm going to try a different project.

    Thanks for trying to help.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.