How to update a window in wpf?

I have a small project I'm working on is a window with 4 WPF tabs on it.

The first tab is where I do most of the work, but sometimes I need to return to other tabs. One of these tabs has a DataGrid tied to a list, which is affected by the main tab that I stay on.

When I update something on the first tab, I need it to cause the data to be updated in Datagrid (usually just to update the value).

The only way he worked is if I click on the title myself.

How to do this in code?

thanks

+4
source share
4 answers

Is the list a ObservableCollection or properties that implement INotifyPropertyChanged ?

You tried:

 myDatagrid.Items.Refresh(); 
+4
source

Maybe:

 this.NavigationService.Refresh(); 

or

 this.NavigationService.Navigate(new Uri("<EnterPage name here.xaml", UriKind.Relative)); 
+4
source

If you are working on an object that displays common properties, you can implement the INotifyPropertyChanged interface and update the DataGrid. If in his collection you can look at the class ObservableCollection .

+1
source

Source: https://habr.com/ru/post/1338659/


All Articles