Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to auto update a Listview - .NET MAUI

I am making an application where there is a history and I want the history to be updated automatically when there is a change in my list. Thank you

like image 386
Emma Avatar asked Sep 13 '25 08:09

Emma


3 Answers

A normal cookie is accessible from JavaScript, and it is also included in every request to the associated domain. A cookie with the HttpOnly attribute is blocked from JavaScript and is only included in requests to the domain.

Then, optionally, you should add the Secure attribute as well to force the cookie only to be sent over HTTPS and not HTTP.

I did write a blog post about Debugging cookie problems for more details about these attributes.

like image 89
Tore Nestenius Avatar answered Sep 15 '25 15:09

Tore Nestenius


you can set a cookie in 2 ways:

  1. by javascript with document.cookie property
  2. by setting the Set-Cookie header from the server

when you specify HTTPOnly attribute in a cookie that means you will not be able access/modify that cookie with javascript (i.e. with document.cookie property), that cookie can be access/modified by the server only

and Is normal cookie same as signed cookie?

no, signed cookie is a cookie whose value has a signature attached to it. it's used in (backend) server while creating a session cookie (for user), where you sign a cookie with a secret key.

like image 27
Mohammad Yasin Avatar answered Sep 15 '25 14:09

Mohammad Yasin


Assuming you're using view models, just bind your ListView to an ObservableCollection<T> in the view model via the ItemsSource dependency property - when the collection changes, the view will update as well. (And if you're not already using MVVM, I'd suggest moving to it ASAP.)

like image 26
Jon Skeet Avatar answered Sep 15 '25 16:09

Jon Skeet