private void editItem_Click(object sender, RoutedEventArgs e)
        {
            var editWindow = new dynEditWindow();

            editWindow.editText.TextChanged += delegate
            {
                var expr = editWindow.editText.GetBindingExpression(TextBox.TextProperty);
                if (expr != null)
                {
                    expr.UpdateSource();
                }
            };

            //setup a binding with the edit window's text field
            editWindow.editText.DataContext = DataContext as dynNoteViewModel;
            var bindingVal = new System.Windows.Data.Binding("Text")
            {
                Mode   = BindingMode.TwoWay,
                Source = (DataContext as dynNoteViewModel),
                UpdateSourceTrigger = UpdateSourceTrigger.Explicit
            };

            editWindow.editText.SetBinding(TextBox.TextProperty, bindingVal);

            if (editWindow.ShowDialog() != true)
            {
                return;
            }
        }
Exemple #2
0
        private void editItem_Click(object sender, RoutedEventArgs e)
        {
            dynEditWindow editWindow = new dynEditWindow();

            //set the text of the edit window to begin
            editWindow.editText.Text = noteText.Text;

            if (editWindow.ShowDialog() != true)
            {
                return;
            }

            //set the value from the text in the box
            noteText.Text = editWindow.editText.Text;
        }
Exemple #3
0
        public override void editWindowItem_Click(object sender, RoutedEventArgs e)
        {
            var editWindow = new dynEditWindow {
                DataContext = this
            };

            var bindingVal = new System.Windows.Data.Binding("Value")
            {
                Mode      = BindingMode.TwoWay,
                Converter = new StringDisplay(),
                NotifyOnValidationError = false,
                Source = this,
                UpdateSourceTrigger = UpdateSourceTrigger.Explicit
            };

            editWindow.editText.SetBinding(TextBox.TextProperty, bindingVal);

            if (editWindow.ShowDialog() != true)
            {
                return;
            }
        }
Exemple #4
0
        private void editWindowItem_Click(object sender, RoutedEventArgs e)
        {
            var editWindow = new dynEditWindow();

            editWindow.DataContext = this;
            var bindingVal = new System.Windows.Data.Binding("Measure.Item.Length")
            {
                Mode                    = BindingMode.TwoWay,
                Converter               = new RevitProjectUnitsConverter(),
                ConverterParameter      = Measure,
                NotifyOnValidationError = false,
                Source                  = this,
                UpdateSourceTrigger     = UpdateSourceTrigger.Explicit
            };

            editWindow.editText.SetBinding(System.Windows.Controls.TextBox.TextProperty, bindingVal);

            if (editWindow.ShowDialog() != true)
            {
                return;
            }
        }
Exemple #5
0
        private void editWindowItem_Click(object sender, RoutedEventArgs e)
        {
            var editWindow = new dynEditWindow();

            editWindow.DataContext = this;
            var bindingVal = new System.Windows.Data.Binding("Measure.Item.Length")
            {
                Mode = BindingMode.TwoWay,
                Converter = new RevitProjectUnitsConverter(),
                ConverterParameter = Measure,
                NotifyOnValidationError = false,
                Source = this,
                UpdateSourceTrigger = UpdateSourceTrigger.Explicit
            };
            editWindow.editText.SetBinding(System.Windows.Controls.TextBox.TextProperty, bindingVal);

            if (editWindow.ShowDialog() != true)
            {
                return;
            }
        }
Exemple #6
0
        void editWindowItem_Click(object sender, RoutedEventArgs e)
        {
            dynEditWindow editWindow = new dynEditWindow();

            //set the text of the edit window to begin
            editWindow.editText.Text = script;

            if (editWindow.ShowDialog() != true)
            {
                return;
            }

            //set the value from the text in the box
            script = editWindow.editText.Text;

            this.dirty = true;
        }
Exemple #7
0
        private void ShowRename()
        {
            var editWindow = new dynEditWindow { DataContext = this };

            var bindingVal = new Binding("NickName")
            {
                Mode = BindingMode.TwoWay,
                NotifyOnValidationError = false,
                Source = this,
                UpdateSourceTrigger = UpdateSourceTrigger.Explicit
            };
            editWindow.editText.SetBinding(TextBox.TextProperty, bindingVal);

            editWindow.Title = "Edit Node Name";

            if (editWindow.ShowDialog() != true)
            {
                return;
            }
        }