Esempio n. 1
0
        /// <summary>
        /// Drop data into this ViewModel
        /// </summary>
        void IDropable.Drop(object data, int index)
        {
            if (data is TVAssetViewModel source)
            {
                if (source.Asset.ParentAssetID == 0 && Customer.ID == source.Asset.CustomerID) //if dragged and dropped yourself, don't need to do anything
                {
                    return;
                }

                SQLiteQueries.UpdateParentAssetID(source.Asset.ID, 0, Customer.ID);
                AssetTreeExViewModel.MoveAsset(source.Asset.ID, 0, Customer.ID);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Drop data into this ViewModel
        /// </summary>
        void IDropable.Drop(object data, int index)
        {
            //if moving within customer, reassign the children to the
            //level above first

            if (data is TVAssetViewModel source)
            {
                if (source.Asset.ID == Asset.ID || source.Asset.ParentAssetID == Asset.ID) //if dragged and dropped yourself, don't need to do anything
                {
                    return;
                }
                SQLiteQueries.UpdateParentAssetID(source.Asset.ID, Asset.ID, Asset.CustomerID);
                AssetTreeExViewModel.MoveAsset(source.Asset.ID, Asset.ID, Asset.CustomerID);
            }
        }