question

VuyiswaMaseko-8882 avatar image
0 Votes"
VuyiswaMaseko-8882 asked VuyiswaMaseko-8882 commented

Update UI Live Xamarin

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 ?

dotnet-xamarinformsdotnet-aspnet-signalr
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LeonLu-MSFT avatar image
1 Vote"
LeonLu-MSFT answered VuyiswaMaseko-8882 commented

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you Very much for the valuable answer , just a follow up question , Wont this be an issue to the resources of the phone ?

0 Votes 0 ·