private void MoveDownCommand_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            DebugHelper.AssertUIThread();

            ObservableCollection <ValueHolder> list = this.ItemsSource as ObservableCollection <ValueHolder>;

            if ((list != null) && (list.Count > 1))
            {
                int index = this.List.SelectedIndex;
                if (index < (list.Count - 1))
                {
                    ValueHolder temp = list[index];
                    list.RemoveAt(index);
                    list.Insert(index + 1, temp);
                    this.List.SelectedIndex = index + 1;
                }
            }
        }
        private void AddCommand_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            DebugHelper.AssertUIThread();

            ObservableCollection <ValueHolder> list = this.ItemsSource as ObservableCollection <ValueHolder>;

            if (list != null)
            {
                ValueHolder newItem = new ValueHolder(this.DefaultValue);

                int index = this.List.SelectedIndex;
                if (index < 0)
                {
                    list.Add(newItem);
                    this.List.SelectedIndex = list.Count - 1;
                }
                else
                {
                    list.Insert(index, newItem);
                    this.List.SelectedIndex = index;
                }
            }
        }