Good afternoon! Tell me how to solve the puzzle:
there is a collection class
public class SortBoard { public double A { get; set; } public double B { get; set; } public double C { get; set; } } There is an announced collection:
public ObservableCollection<SortBoard> collection; And there is a main class of the program where calculations are performed.
class Program { public ObservableCollection<SortBoard> collection; public double k; static void Main(string[] args) { collection = new ObservableCollection<SortBoard>(); collection.Add(new SortBoard() {A=10,B=20,C=30}); collection.Add(new SortBoard() {A=12,B=18,C=33}); for (int i =0; i<500;i++) { if (i % 2 ) { k=i*0.35; } } } } How can you implement an event in which when "k" is changed so that the data in the collection is updated according to the following logic:
A = C * 2 * k B = C * 3 * k
I can not understand how to delegates and events here to tie