public NumberNodeViewModel(object parentNode, NumberModel model)
            : base(model)
        {
            _parentNode = parentNode;
            Items       = new ObservableCollection <NumberNodeViewModel>();

            var converter = new LambdaValueConverter <IDraggable, NumberModel>(
                d => (d is NumberViewModel) ? (d as NumberViewModel).Model : null,
                nm => new NumberNodeViewModel(this, nm));

            DragHelper = new LambdaDragHelper <NumberModel>(converter,
                                                            () => GetAllSubItems(true).Select(nvm => nvm.Model).ToList(),
                                                            nms => DragDropEffectsEx.Move,
                                                            (nms, eff) =>
            {
                if (parentNode is NumberNodeViewModel)
                {
                    (parentNode as NumberNodeViewModel).Items.Remove(this);
                }
                else if (parentNode is NumberTreeViewModel)
                {
                    (parentNode as NumberTreeViewModel).Items.Remove(this);
                }

                //foreach (var nm in nms)
                //    Items.Remove(new NumberNodeViewModel(this, nm));
            }
                                                            );
            DropHelper = new LambdaDropHelper <NumberModel>(converter,
                                                            (nms, eff) =>
            {
                foreach (var nm in nms)
                {
                    if (Items.Any(ivm => ivm.Model.Equals(nm)))
                    {
                        return(QueryDropEffects.None);
                    }
                }
                return(QueryDropEffects.CreateNew(DragDropEffectsEx.Move));
            },
                                                            (nms, eff) =>
            {
                foreach (var nm in nms)
                {
                    Items.Add(new NumberNodeViewModel(this, nm));
                }
                return(DragDropEffectsEx.Move);
            })
            {
                DisplayName = "Node " + model.Value.ToString()
            };
        }
 public NumberViewModel(NumberModel model)
 {
     Model       = model;
     DisplayName = model.Value.ToString();
 }