private void lookUpEdit_ProcessNewValue(DependencyObject sender, DevExpress.Xpf.Editors.ProcessNewValueEventArgs e)
        {
            if (!(bool)chProcessNewValue.IsChecked)
            {
                return;
            }

            control = new ContentControl {
                Template = (ControlTemplate)Resources["addNewRecordTemplate"], Tag = e
            };
            Product row = new Product();

            row.ProductName = e.DisplayText;

            control.DataContext = row;
            FrameworkElement     owner        = sender as FrameworkElement;
            DialogClosedDelegate closeHandler = CloseAddNewRecordHandler;

            FloatingContainer.ShowDialogContent(control, owner, Size.Empty, new FloatingContainerParameters()
            {
                Title              = "Add New Record",
                AllowSizing        = false,
                ClosedDelegate     = closeHandler,
                ContainerFocusable = false,
                ShowModal          = true
            });

            e.PostponedValidation = true;
            e.Handled             = true;
        }
Esempio n. 2
0
        private void PART_Editor_ProcessNewValue(DependencyObject sender, DevExpress.Xpf.Editors.ProcessNewValueEventArgs e)
        {
            ComboBoxEdit ic   = sender as ComboBoxEdit;
            var          list = ic.ItemsSource as List <Hammergo.GlobalConfig.ParamInfo>;

            Hammergo.GlobalConfig.ParamInfo np = new Hammergo.GlobalConfig.ParamInfo();
            np.Name = e.DisplayText;


            list.Add(np);

            tempParamList.Add(np);

            e.Handled = true;
        }
Esempio n. 3
0
        void searchLookUpEdit_ProcessNewValue(DependencyObject sender, DevExpress.Xpf.Editors.ProcessNewValueEventArgs e)
        {
            if (control != null)
            {
                return;
            }
            control = new ContentControl {
                Template = (ControlTemplate)Resources["addNewRecordTemplate"]
            };
            Employee row = new Employee();

            row.LastName  = e.DisplayText;
            row.Id        = NewItemRowID;
            row.BirthDate = DateTime.Now.AddYears(-21).Date;

            control.DataContext = row;
            FrameworkElement     owner = sender as FrameworkElement;
            DialogClosedDelegate closeHandler;

            closeHandler = (bool?close) => {
                if (close != null && (bool)close)
                {
                    Employees.Add(control.DataContext);
                }
                control = null;
            };
            dialogOwner = FloatingContainer.ShowDialogContent(control, owner, Size.Empty, new FloatingContainerParameters()
            {
                Title              = "Add New Record",
                AllowSizing        = false,
                ClosedDelegate     = closeHandler,
                ContainerFocusable = false,
                ShowModal          = false
            });
            e.PostponedValidation = true;
            e.Handled             = true;
            ((FloatingContainer)dialogOwner).Hiding += SearchLookUpEditModule_Closing;
        }