/// <summary>
        /// The populate assign feature drog drag.
        /// </summary>
        /// <param name="selectedFeatureTypes">
        /// The selected feature types.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task PopulateAssignFeatureDrogDrag(ObservableCollection<AssetFeatureTypeRowItem> selectedFeatureTypes)
        {
            // create Select one or more in drag drop
            var listDragDropCat = new ListDragDropViewModel(1, CatKey);
            var listDragDropType = new ListDragDropViewModel(2, TypeKey);

            string assetTypeKey = TypeKey + Guid.NewGuid().ToString();
            string assetCategoryKey = CatKey + Guid.NewGuid().ToString();
            listDragDropCat.Key = assetCategoryKey;
            listDragDropType.Key = assetTypeKey;
            listDragDropCat.ChangeVisibilityHeader = Visibility.Collapsed;
            listDragDropType.ChangeVisibilityHeader = Visibility.Collapsed;
            listDragDropCat.Items = new ObservableCollection<ItemDragDrop>();
            listDragDropType.Items = new ObservableCollection<ItemDragDrop>();

            var categoriesList = await AssetClassesCategoryFunctions.GetAssetCategoriesList();
            var typesList = await AssetClassesTypeFunctions.GetAssetTypesList();

            foreach (var category in categoriesList)
            {
                listDragDropCat.Items.Add(
                    new ItemDragDrop { ID = category.EquipCatId, Name = category.Description, Key = assetCategoryKey });
            }

            foreach (var type in typesList)
            {
                listDragDropType.Items.Add(
                    new ItemDragDrop { ID = type.EquipTypeId, Name = type.Description, Key = assetTypeKey });
            }

            this.ListSelectCategories = listDragDropCat;
            this.ListSelectCategories.IsConstantSource = true;

            this.ListSelectTypes = listDragDropType;
            this.ListSelectTypes.IsConstantSource = true;

            // create feature control
            var groupFeatureViewModel = new GroupAssetFeatureDragDropViewModel();
            groupFeatureViewModel.GroupAssetDragDropSource = new ObservableCollection<ItemAssetFeatureDragDropViewModel>();

            foreach (var selectedFeature in selectedFeatureTypes)
            {
                var itemGroupViewModel = new ItemAssetFeatureDragDropViewModel();

                itemGroupViewModel.HeaderName = selectedFeature.FeatureName;
                itemGroupViewModel.Id = selectedFeature.FeatureTypeId;

                itemGroupViewModel.AssetCategoryViewModel = new ListDragDropViewModel(1, CatKey);
                itemGroupViewModel.AssetTypeViewModel = new ListDragDropViewModel(2, TypeKey);

                itemGroupViewModel.AssetCategoryViewModel.ChangeVisibilityHeader = Visibility.Collapsed;
                itemGroupViewModel.AssetTypeViewModel.ChangeVisibilityHeader = Visibility.Collapsed;

                itemGroupViewModel.AssetCategoryViewModel.Key = assetCategoryKey;
                itemGroupViewModel.AssetTypeViewModel.Key = assetTypeKey;

                itemGroupViewModel.AssetCategoryViewModel.Items = new ObservableCollection<ItemDragDrop>();
                itemGroupViewModel.AssetTypeViewModel.Items = new ObservableCollection<ItemDragDrop>();

                var categoryFeaturesList = (await AssetFeatureFunction.GetAssetCategoriesFeatureAsync(selectedFeature.FeatureTypeId)).Where(asset => asset.IsSelected).ToList();
                var typeFeaturesList = (await AssetFeatureFunction.GetAssetTypesFeatureAsync(selectedFeature.FeatureTypeId)).Where(asset => asset.IsSelected).ToList();

                // load categoryFeature and typeFeature list for each feature
                foreach (var categoryFeature in categoryFeaturesList)
                {
                    itemGroupViewModel.AssetCategoryViewModel.Items.Add(new ItemDragDrop { ID = categoryFeature.EquipCatId, Name = categoryFeature.EquipCatName, Key = assetCategoryKey });
                }

                foreach (var typeFeature in typeFeaturesList)
                {
                    itemGroupViewModel.AssetTypeViewModel.Items.Add(new ItemDragDrop { ID = typeFeature.EquipTypeId, Name = typeFeature.EquipTypeName, Key = assetTypeKey });
                }

                groupFeatureViewModel.GroupAssetDragDropSource.Add(itemGroupViewModel);
            }

            this.AssetFeatureDragDropViewModel = groupFeatureViewModel;
            this.AssetFeatureDragDropViewModel.NotifyItemsChanged();
        }
        /// <summary>
        /// The get list make items.
        /// </summary>
        /// <param name="allItemsSelected">
        /// The all items selected.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task GetListMakeItems(ObservableCollection<AssetClassesTypeRowItem> allItemsSelected)
        {
            List<AssetClassesCategoryItemDetail> listMakeItem = await AssetClassesTypeFunctions.GetListMakeItems();

            this.ListAllAssetTypesItems = new ListDragDropViewModel(1, FeatureKey);

            this.ListAllAssetTypesItems.Key = FeatureKey;
            this.ListAllAssetTypesItems.ChangeVisibilityHeader = Visibility.Collapsed;
            this.ListAllAssetTypesItems.Items = new ObservableCollection<ItemDragDrop>();
            this.ListAllAssetTypesItems.IsConstantSource = true;
            foreach (var item in listMakeItem)
            {
                this.ListAllAssetTypesItems.Items.Add(
                    new ItemDragDrop { ID = item.ItemId, Name = item.Text, Key = FeatureKey });
            }

            this.ListAllAssetTypesItems.Items = new ObservableCollection<ItemDragDrop>(this.ListAllAssetTypesItems.Items.OrderBy(a => a.Name));

            this.ListItemsDragDrop = new GroupDragDropViewModel();
            ObservableCollection<ListDragDropViewModel> listItemsDragDropViewModel = new ObservableCollection<ListDragDropViewModel>();

            foreach (var itemSelected in allItemsSelected)
            {
                var featuresItem = new ListDragDropViewModel(itemSelected.EquipTypeId, itemSelected.TypeDescription);
                featuresItem.Key = FeatureKey;
                featuresItem.ChangeVisibilityHeader = Visibility.Collapsed;
                featuresItem.Items = new ObservableCollection<ItemDragDrop>();

                var listItemSelected = await AssetClassesTypeFunctions.GetListMakeItemsSelected(itemSelected.EquipTypeId);

                if (listItemSelected.Count > 0)
                {
                    foreach (var itemId in listItemSelected)
                    {
                        var item = listMakeItem.FirstOrDefault(x => x.ItemId == itemId);
                        if (item != null)
                        {
                            featuresItem.Items.Add(new ItemDragDrop { ID = item.ItemId, Name = item.Text, Key = FeatureKey });
                        }
                    }
                }

                listItemsDragDropViewModel.Add(featuresItem);
            }

            this.ListItemsDragDrop.GroupDragDropSource = new ObservableCollection<ListDragDropViewModel>(listItemsDragDropViewModel);
            this.ListItemsDragDrop.GroupDragDropSource = listItemsDragDropViewModel;
            this.ListItemsDragDrop.NotifyItemsChanged();
            this.ListItemsDragDrop.PropertyChanged += this.AssetCategoryAssignTypesViewModel_PropertyChanged;
        }
        /// <summary>
        /// The get list model items.
        /// </summary>
        /// <param name="allItemsSelected">
        /// The all items selected.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task GetListModelItems(ObservableCollection<AssetClassesMakeRowItem> allItemsSelected)
        {
            List<AssetClassesMakeItemDetail> listModelItem = await AssetClassesMakeFunctions.GetAllModelItems();

            this.ListAllModelItems = new ListDragDropViewModel(1, ModelKey);

            this.ListAllModelItems.Key = ModelKey;
            this.ListAllModelItems.ChangeVisibilityHeader = Visibility.Collapsed;
            this.ListAllModelItems.Items = new ObservableCollection<ItemDragDrop>();
            this.ListAllModelItems.IsConstantSource = true;

            foreach (var item in listModelItem)
            {
                this.ListAllModelItems.Items.Add(
                    new ItemDragDrop { ID = item.ItemId, Name = item.Text, Key = ModelKey });
            }

            this.ListAllModelItems.Items = new ObservableCollection<ItemDragDrop>(this.ListAllModelItems.Items.OrderBy(a => a.Name));

            this.ListItemsDragDrop = new GroupDragDropViewModel();
            ObservableCollection<ListDragDropViewModel> listItemsDragDropViewModel = new ObservableCollection<ListDragDropViewModel>();
            foreach (var itemSelected in allItemsSelected)
            {
                var modelItem = new ListDragDropViewModel(itemSelected.EquipMakeId, itemSelected.Description);
                modelItem.Key = ModelKey;
                modelItem.ChangeVisibilityHeader = Visibility.Collapsed;
                modelItem.Items = new ObservableCollection<ItemDragDrop>();

                var listItemSelected = AssetClassesMakeFunctions.GetListModelItemsSelected(itemSelected.EquipMakeId);

                if (listItemSelected.Count > 0)
                {
                    foreach (var itemId in listItemSelected)
                    {
                        var item = listModelItem.FirstOrDefault(x => x.ItemId == itemId);
                        if (item != null)
                        {
                            modelItem.Items.Add(new ItemDragDrop { ID = item.ItemId, Name = item.Text, Key = ModelKey });
                        }
                    }
                }

                listItemsDragDropViewModel.Add(modelItem);
            }

            this.ListItemsDragDrop.GroupDragDropSource = new ObservableCollection<ListDragDropViewModel>(listItemsDragDropViewModel);
            this.ListItemsDragDrop.GroupDragDropSource = listItemsDragDropViewModel;
            this.ListItemsDragDrop.NotifyItemsChanged();
        }
        /// <summary>
        /// The get list collateral items.
        /// </summary>
        /// <param name="allItemsSelected">
        /// The all items selected.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task GetListCollateralItems(ObservableCollection<AssetCollateralRowItem> allItemsSelected)
        {
            List<AssetClassesTypeItemDetail> listTypesItem;
            listTypesItem = await AssetCollateralClassesFunction.GetAllTypesItems();
            this.ListAllTypesItems = new ListDragDropViewModel(1, TypeKey);
            this.ListAllTypesItems.Key = TypeKey;
            this.ListAllTypesItems.ChangeVisibilityHeader = Visibility.Collapsed;
            this.ListAllTypesItems.Items = new ObservableCollection<ItemDragDrop>();
            this.ListAllTypesItems.IsConstantSource = true;

            foreach (var item in listTypesItem)
            {
                this.ListAllTypesItems.Items.Add(
                    new ItemDragDrop { ID = item.ItemId, Name = item.Text, Key = TypeKey });
            }

            this.ListItemsDragDrop = new GroupDragDropViewModel();
            ObservableCollection<ListDragDropViewModel> listItemsDragDropViewModel = new ObservableCollection<ListDragDropViewModel>();

            foreach (var itemSelected in allItemsSelected)
            {
                var typesItem = new ListDragDropViewModel(itemSelected.CollateralClassID, itemSelected.Description);
                typesItem.Key = TypeKey;
                typesItem.ChangeVisibilityHeader = Visibility.Collapsed;
                typesItem.Items = new ObservableCollection<ItemDragDrop>();

                var listItemSelected = await AssetCollateralClassesFunction.GetListTypesItemsSelected(itemSelected.CollateralClassID);

                if (listItemSelected.Count > 0)
                {
                    foreach (var itemId in listItemSelected)
                    {
                        var item = listTypesItem.FirstOrDefault(x => x.ItemId == itemId);
                        if (item != null)
                        {
                            typesItem.Items.Add(new ItemDragDrop { ID = item.ItemId, Name = item.Text, Key = TypeKey });
                        }
                    }
                }

                for (int i = 0; i < this.ListAllTypesItems.Items.Count; i++)
                {
                    if (listItemSelected.Contains(this.ListAllTypesItems.Items[i].ID))
                    {
                        this.ListAllTypesItems.Items[i].IsNoneDropItem = true;
                    }
                }

                for (int i = 0; i < this.ListAllTypesItems.Items.Count; i++)
                {
                    if (listItemSelected.Contains(this.ListAllTypesItems.Items[i].ID))
                    {
                        this.ListAllTypesItems.Items[i].IsNoneDropItem = true;
                    }
                }

                listItemsDragDropViewModel.Add(typesItem);
            }
            
            this.ListItemsDragDrop.GroupDragDropSource = new ObservableCollection<ListDragDropViewModel>(listItemsDragDropViewModel);
            this.ListItemsDragDrop.GroupDragDropSource = listItemsDragDropViewModel;
            foreach (var source in this.ListItemsDragDrop.GroupDragDropSource)
            {
                source.Items.CollectionChanged += this.ItemsAdd_CollectionChanged;
            }

            this.ListItemsDragDrop.NotifyItemsChanged();
            this.ListItemsDragDrop.PropertyChanged += this.AssetCollateralAssignTypeViewModel_PropertyChanged;
        }