Пример #1
0
 void ModelPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     switch (e.PropertyName)
     {
     case nameof(viewModel.Sessions):
         (ISet <SessionModel> removedModels, _, ISet <SessionModel> addedModels) = e.Diff <SessionModel>();
         foreach (SessionModel model in removedModels)
         {
             sessions.RemoveSession(model);
         }
         foreach (SessionModel model in addedModels)
         {
             sessions.AddSession(model);
         }
         break;
     }
 }