public event PropertyChangedEventHandler? PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string prop = "")
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(prop));
}
DelegateName.Invoke(....);
private ContextMenu NewColumnContextMenu()
{
// Создание шаблона Сontext menu
return contextMenu;
}
Func<ContextMenu> NewColumnContextMenu = () =>
{
// Создание шаблона Сontext menu
return contextMenu;
};
public class Student : INotifyPropertyChanged
{
public Student()
{
sum = new Result();
Results = new ObservableCollection<Result>();
}
private string? name;
private string? group;
private Result? sum;
private int? rating;
public string? Name
{
get { return name; }
set
{
name = value;
OnPropertyChanged("Name");
}
}
public string? Group
{
get { return group; }
set
{
group = value;
OnPropertyChanged("Group");
}
}
public Result? Sum
{
get { return sum; }
set
{
sum = value;
OnPropertyChanged("Sum");
}
}
public int? Rating
{
get { return rating; }
set
{
rating = value;
OnPropertyChanged("Rating");
}
}
public ObservableCollection<Result> Results { get; set; }
public class Result : INotifyPropertyChanged
{
private int? value;
private DateTime? time;
private int? rating;
public int? Value
{
get { return value; }
set
{
this.value = value;
OnPropertyChanged("Value");
}
}
public DateTime? Time
{
get { return time; }
set
{
time = value;
OnPropertyChanged("Time");
}
}
public int? Rating
{
get { return rating; }
set
{
rating = value;
OnPropertyChanged("Rating");
}
}
public event PropertyChangedEventHandler? PropertyChanged;
public void OnPropertyChanged([CallerMemberName] string prop = "")
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(prop));
}
}
public event PropertyChangedEventHandler? PropertyChanged;
public void OnPropertyChanged([CallerMemberName] string prop = "")
{
if (PropertyChanged != null)
PropertyChanged(this, new PropertyChangedEventArgs(prop));
}
}