コード例 #1
0
        void ViewModel_RequestShowNodeRename(object sender, EventArgs e)
        {
            var editWindow = new dynEditWindow {
                DataContext = ViewModel
            };

            var bindingVal = new Binding("NickName")
            {
                Mode = BindingMode.TwoWay,
                NotifyOnValidationError = false,
                Source = ViewModel,
                UpdateSourceTrigger = UpdateSourceTrigger.Explicit
            };

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

            editWindow.Title = "Edit Node Name";

            if (editWindow.ShowDialog() != true)
            {
                return;
            }
        }
コード例 #2
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;
            }
        }