I have a ListView :
<ListView.View> <GridView> <GridViewColumn x: Name = "KeyColumn1" Header = "Key" Width = "100" DisplayMemberBinding = "{Binding Path=Label}"/ > <GridViewColumn x: Name = "ValueColumn1" Header = "Value" Width = "130" DisplayMemberBinding = "{Binding Path=Value}"/> </GridView> </ListView.View>
Time is defined as: public DateTime time = DateTime.Now;
How can I update time in two different ways? I was able to get the time and display it in Ringing() , but the time is not updated in Established() .
private void Ringing() { CallTabLv1.Items.Add(new { Label = "Time", Value = time.ToString() }); CallTabLv1.Items.Add(new { Label = "Call Type", Value = "Call in" }); } private void Established() { CallTabLv1.Items.Refresh(); }
I know that the easiest way is to clear the elements and add them to Established() again, but since more than two elements need to be added, I do not want the code to look long and duplicated. Another way that I thought was to delete a specific row and then insert again, but this method is not suitable since my data is dynamic.
source share