Пример #1
0
        private void DragFromGroup(IDataSourceViewModel source, IDataSourceViewModel dest, MergedDataSourceViewModel parent)
        {
            parent.RemoveChild(source);
            DissolveGroupIfNecessary(parent);

            Drag(source, dest);
        }
Пример #2
0
        private void DissolveGroupIfNecessary(MergedDataSourceViewModel group)
        {
            if (group.ChildCount == 1)
            {
                int groupIndex = _observable.IndexOf(group);
                _observable.RemoveAt(groupIndex);
                _dataSources.Remove(group.DataSource);

                IDataSourceViewModel child = group.Observable.First();
                group.RemoveChild(child);
                _observable.Insert(groupIndex, child);
            }
        }