Update UI Live Xamarin

Vuyiswa Maseko 351 Reputation points
2021-05-30T21:36:48.753+00:00

Good Day All

i have an app with similar functionality as Twitter and Facebook. in the app a user can like a post . which means when a user tabs the like button , it will update on the db that this post has been liked by User X and the increase of likes will show e.g Likes 1.

Now my here is my scenario

User X likes a post from [device 1]

and User X2 must be able to see the likes increase from [device 2]

How can i achieve that ?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,294 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,254 questions
0 comments No comments
{count} vote

Accepted answer
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 68,571 Reputation points Microsoft Vendor
    2021-05-31T02:23:58.187+00:00

    Hello,​

    Welcome to our Microsoft Q&A platform!

    You can request data from DB with device timer or Task like following code, then refresh data in the view.

       Device.StartTimer(TimeSpan.FromMinutes(1), () =>  
       {  
          var shouldTimerContinueWork = true;  
          /*your code*/  
          return shouldTimerContinueWork;  
       });  
    
    
       System.Threading.Tasks.Task.Run(() =>  
        {  
             //Add your code here.  
        }).ConfigureAwait(false);  
    

    Best Regards,

    Leon Lu


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful