Esempio n. 1
0
        protected override bool CanDrag(ref object data, string propertyName)
        {
            if (SelectedItem?.Item == null)
            {
                return(false);
            }
            Transaction transaction = SelectedItem.Item;

            List <string> allowedProperties = transaction.GetNames(
                () => transaction.AccountNumber,
                () => transaction.Details,
                () => transaction.Title,
                () => transaction.CounterPartData);


            List <string> lowercased         = allowedProperties.Select(p => p.ToLower()).ToList();
            string        propertyLowerCased = propertyName.ToLower();


            if (!lowercased.Contains(propertyLowerCased))
            {
                return(false);
            }
            TransactionDropDownData transactionDropDownData = new TransactionDropDownData()
            {
                Transaction    = transaction,
                PickedProperty = propertyName
            };

            data = transactionDropDownData;
            return(true);
        }
Esempio n. 2
0
        protected override void OnDragDrop(DragEventArgs dragEventArgs)
        {
            IDataObject data = dragEventArgs.Data;

            TransactionDropDownData transactionDropDownData =
                data.GetData(typeof(TransactionDropDownData)) as TransactionDropDownData;

            if (transactionDropDownData.IsNullObj())
            {
                return;
            }

            DoDrop(transactionDropDownData.PickedProperty, transactionDropDownData.Transaction);
        }
Esempio n. 3
0
        protected override void OnDragDrop(ITreeViewItem item, IDataObject data)
        {
            SubCategory subCategory = item as SubCategory;

            if (subCategory.IsNullObj())
            {
                return;
            }

            TransactionDropDownData transactionDropDownData =
                data.GetData(typeof(TransactionDropDownData)) as TransactionDropDownData;

            if (transactionDropDownData.IsNullObj())
            {
                return;
            }

            EventTransactionDropped eventTransactionDropped = new EventTransactionDropped();

            eventTransactionDropped.TransactionDropDownData = transactionDropDownData;

            _aggregator.PublishEvent <EventTransactionDropped>(eventTransactionDropped);
        }
Esempio n. 4
0
        protected override bool CanDrop(DragEventArgs dragEventArgs)
        {
            IDataObject data = dragEventArgs.Data;

            if (data.IsNullObj())
            {
                return(false);
            }

            TransactionDropDownData transactionDropDownData =
                data.GetData(typeof(TransactionDropDownData)) as TransactionDropDownData;

            if (transactionDropDownData.IsNullObj())
            {
                return(false);
            }

            if (transactionDropDownData.Transaction.IsNullObj())
            {
                return(false);
            }

            return(true);
        }