0

I am trying to make a network call when a page is navigated to in windows phone 8.1 and then use the results to set the value of TextBlocks on the page but it seems to fail always.I have seen solutions which are not clear

 async protected override  void OnNavigatedTo(NavigationEventArgs e)
    {
        //Make the async call 
        Dictionary<string, string> result = await BoardService.getBoard((e.Parameter as Board).id);

        //use the results to set the text of the TextBlock
        txtBlockDesc.Text = result[Constants.SUCCESS];
    }

Any assistance will be appreciated.

Sam Ngugi
  • 1,103
  • 9
  • 13
  • txtBlockDesc.Text remains empty even after the BoardService.getBoard(board.id) is completed. – Sam Ngugi Feb 24 '16 at 06:27
  • maybe `result[Constants.SUCCESS]` is empty. You should try to debug the contents of the result dictionary – Tyress Feb 24 '16 at 06:46
  • I think I know where the problem is , I just noticed that onNavigatedTo is fired twice for some reason. Maybe you can assist me@Tyress – Sam Ngugi Feb 24 '16 at 07:02
  • You should make a new question :)...unless when you look around SO you find an answer e.g. [here](http://stackoverflow.com/questions/19041432/wp8-onnavigatedto-fires-twice-after-tapping-on-toast-notification) and [here](http://stackoverflow.com/questions/16899509/onnavigatedto-is-called-two-twice-on-app-resuming) – Tyress Feb 24 '16 at 07:06

0 Answers0