private async void LoadOrderTypesAsync() { OrderTypes.Clear(); OrderTypes.Add(new OrderType() { Id = Guid.Empty, Name = "" }); var types = await _typeRepository.GetAllAsync(); foreach (var type in types) { OrderTypes.Add(type); } }
private async Task LoadTypes() { foreach (var type in OrderTypes) { type.PropertyChanged -= WrappedType_PropertyChanged; } OrderTypes.Clear(); var types = await _orderTypeRepository.GetAllAsync(); foreach (var type in types) { var wrappedType = new OrderTypeWrapper(type); wrappedType.PropertyChanged += WrappedType_PropertyChanged; OrderTypes.Add(wrappedType); } }