/// <summary> /// Registers the view model with the model, so that the model can fire change notifications /// </summary> /// <param name="vm"></param> public void Register(BeGattVmBase <TGattObjectType> vm) { lock (ViewModelInstances) { if (vm == null) { throw new ArgumentNullException("Tried to register a null-valued view-model to a model."); } ViewModelInstances.Add(vm); } }
/// <summary> /// Unregisters the view model from the model /// </summary> /// <param name="vm"></param> public void UnregisterVmFromModel(BeGattVmBase <TGattObjectType> vm) { lock (ViewModelInstances) { if (vm == null) { throw new ArgumentNullException("Tried to remove a null-valued view-model from a model"); } if (ViewModelInstances.Contains(vm)) { ViewModelInstances.Remove(vm); } } }