コード例 #1
0
        public void Drop(object o)
        {
            var treeViewItem = o as IWordTreeViewItem;

            if (treeViewItem != null)
            {
                Children.Insert(0, treeViewItem);
                treeViewItem.Parent = this;
            }

            var stringItem = o as string;

            if (stringItem != null)
            {
                var newWord = new WordViewModel(stringItem, this, DataService);

                Children.Insert(0, newWord);
                newWord.Parent = this;
            }
        }
コード例 #2
0
        public void Drop(object o)
        {
            var treeViewItem = o as IWordTreeViewItem;

            if (treeViewItem != null)
            {
                int myIndex = Parent.Children.IndexOf(this);
                Parent.Children.Insert(myIndex + 1, treeViewItem);
                treeViewItem.Parent = Parent;
            }

            var str = o as string;

            if (str != null)
            {
                int myIndex = Parent.Children.IndexOf(this);

                var newItem = new WordViewModel(str, Parent, DataService);

                Parent.Children.Insert(myIndex + 1, newItem);
                newItem.Parent = Parent;
            }
        }