Привет, я использую wpf mvvm, и моя таблица данных не обновляет scource после удаления строки. Может ли мне помочь какая-нибудь помощь, пожалуйста, вот моя модель представления:
public class UserPaymentsVM : ViewModelBase
{
private IDataProvider _dataProvider;
private int _selectedClientID;
public Clients Client { get; set; }
private List<Payments> _payments;
public List<Payments> payments
{
get { return _payments; }
set { _payments = value; RaisePropertyChanged(nameof(payments)); }
}
и вот мое мнение
<Grid Background="Azure">
<DataGrid ItemsSource="{Binding Path=payments, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
AutoGenerateColumns="True"
Height="350"
VerticalAlignment="Top"
SelectedValuePath="pid"
SelectedValue="{Binding PayID}">
</DataGrid>
<Button Height="50" Width="100" Content="Remove" HorizontalAlignment="Center" VerticalAlignment="Bottom" Command="{Binding RemovePayment}"/>
</Grid>
</UserControl>