private void AttributeChangesListView_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            AttributeChangesViewModel vm = ((ListView)sender).DataContext as AttributeChangesViewModel;

            if (vm == null)
            {
                return;
            }

            AttributeChangeViewModel attributeChange = vm.FirstOrDefault(t => t.IsSelected);

            if (attributeChange == null)
            {
                return;
            }

            ValueChangeViewModel valueChange = attributeChange.ValueChanges.FirstOrDefault(t => t.IsSelected);

            if (valueChange == null)
            {
                valueChange = attributeChange.ValueChanges.FirstOrDefault();

                if (valueChange == null)
                {
                    return;
                }
            }

            valueChange.EditValueChange();
        }
Ejemplo n.º 2
0
        public ValueChangesViewModel(IList <ValueChange> model, AttributeChangeViewModel parent)
            : base()
        {
            this.ParentAttributeChange = parent;
            this.SetCollectionViewModel(model, t => this.ViewModelResolver(t));

            this.Commands.AddItem("AddValueChangeAdd", t => this.AddValueChangeAdd(), t => this.CanAddValueChangeAdd());
            this.Commands.AddItem("AddValueChangeDelete", t => this.AddValueChangeDelete(), t => this.CanAddValueChangeDelete());
            this.Commands.AddItem("EditValueChange", t => this.EditValueChange(), t => this.CanEditValueChange());

            if (this.Count > 0)
            {
                this.FirstOrDefault().IsSelected = true;
            }
        }