private async void LoadOrderStatusesAsync() { OrderStatuses.Clear(); OrderStatuses.Add(new OrderStatus() { Id = Guid.Empty, Name = "" }); var statuses = await _statusRepository.GetAllAsync(); foreach (var status in statuses) { OrderStatuses.Add(status); } }
private async Task LoadStatuses() { var statuses = await _orderStatusRepository.GetAllAsync(); foreach (var status in OrderStatuses) { status.PropertyChanged -= WrappedStatus_PropertyChanged; } OrderStatuses.Clear(); foreach (var status in statuses) { var wrappedStatus = new OrderStatusWrapper(status); wrappedStatus.PropertyChanged += WrappedStatus_PropertyChanged; OrderStatuses.Add(wrappedStatus); } }