private void OnMove(bool up)
        {
            List <Domain.AttributeValue> attributeValues = GetSelectedValues();

            if (attributeValues.Count == 0)
            {
                return;
            }
            if (up)
            {
                attributeValues.BubbleSort();
            }
            else
            {
                attributeValues.BubbleSortDesc();
            }
            foreach (Domain.AttributeValue attributeValue in attributeValues)
            {
                Domain.AttributeValue parent = attributeValue.parent;
                if (parent == null)
                {
                    parent = this.Root;
                }

                ForgetDefaultAttributeValues(parent);
                int position = attributeValue.position + (up ? -1 : 1);
                Domain.AttributeValue child = (Domain.AttributeValue)parent.GetChildByPosition(position);
                if (child != null)
                {
                    child.SetPosition(attributeValue.position);
                    parent.UpdateChild(child);
                    attributeValue.SetPosition(position);
                    parent.UpdateChild(attributeValue);

                    int row = Source.IndexOf(child);
                    Source.Remove(attributeValue);
                    Source.Insert(row, attributeValue);
                }
                AddDefaultAttributeValues(parent);
            }
            treeList.SelectedItems = attributeValues;
            if (Changed != null)
            {
                Changed();
            }
        }
        private void OnIndentClick(object sender, RoutedEventArgs e)
        {
            List <Domain.AttributeValue> attributeValues = GetSelectedValues();

            if (attributeValues.Count == 0)
            {
                return;
            }
            attributeValues.BubbleSort();
            foreach (Domain.AttributeValue attributeValue in attributeValues)
            {
                Domain.AttributeValue parent = attributeValue.parent;
                if (parent == null)
                {
                    parent = this.Root;
                }
                int position = attributeValue.GetPosition();
                Domain.AttributeValue brother = (Domain.AttributeValue)parent.GetChildByPosition(position - 1);
                if (brother == null)
                {
                    return;
                }
                ForgetDefaultAttributeValues(parent);
                parent.ForgetChild(attributeValue);
                brother.AddChild(attributeValue);
                brother.IsExpanded = true;

                int row = Source.IndexOf(brother);
                Source.Remove(brother);
                Source.Insert(row, brother);
                AddDefaultAttributeValues(parent);
            }
            treeList.SelectedItems = attributeValues;
            if (Changed != null)
            {
                Changed();
            }
        }