private async Task SelectAll(bool isCheck, string direction) { var list = _leftDataSource; if (direction == TransferDirection.Right) { list = _rightDataSource; } var holder = isCheck ? list.Where(a => !a.Disabled).Select(a => a.Key).ToList() : new List <string>(list.Count()); HandleSelect(direction, holder); MathTitleCount(); if (OnSelectChange.HasDelegate) { await OnSelectChange.InvokeAsync(new TransferSelectChangeArgs(_sourceSelectedKeys.ToArray(), _targetSelectedKeys.ToArray())); } }
private async Task SelectItem(bool isCheck, string direction, string key) { var holder = direction == TransferDirection.Left ? _sourceSelectedKeys : _targetSelectedKeys; var index = Array.IndexOf(holder.ToArray(), key); if (index > -1) { holder.RemoveAt(index); } if (isCheck) { holder.Add(key); } HandleSelect(direction, holder); MathTitleCount(); if (OnSelectChange.HasDelegate) { await OnSelectChange.InvokeAsync(new TransferSelectChangeArgs(_sourceSelectedKeys.ToArray(), _targetSelectedKeys.ToArray())); } }