Пример #1
0
            void ccb_ItemSelectionChanged(object sender, Xceed.Wpf.Toolkit.Primitives.ItemSelectionChangedEventArgs e)
            {
                Xceed.Wpf.Toolkit.CheckComboBox ccb = (Xceed.Wpf.Toolkit.CheckComboBox)sender;
                int mask = 0;

                foreach (var item in ccb.SelectedItems)
                {
                    double index = Convert.ToDouble(item.ToString().Substring(6));
                    mask = mask + (int)Math.Pow(2, index);
                }
                ccb.Text = mask.ToString("000");

                var Selection = designerCanvas.SelectionService.CurrentSelection;
                ViewModelDesignerItem Ditem = new ViewModelDesignerItem();

                foreach (var slc in Selection)
                {
                    Ditem = (ViewModelDesignerItem)slc;
                }
                DockPanel    Sourcepnl        = (DockPanel)Ditem.Content;
                PropertyGrid SelectedPgrid    = designerCanvas.TransactionList.Find(x => x.Id == Sourcepnl.Uid).PropertyGrid;
                string       SelectedProperty = property.DisplayName;
                string       newValue         = ccb.Text;
                StateY       stated           = (StateY)SelectedPgrid.SelectedObject;

                Type         ClassType    = stated.GetType();
                PropertyInfo propertyName = ClassType.GetProperty(SelectedProperty);

                propertyName.SetValue(stated, newValue, null);
                designerCanvas.TransactionList.Find(x => x.Id == Sourcepnl.Uid).PropertyGrid.SelectedObject = stated;
            }
Пример #2
0
            public FrameworkElement ResolveEditor(PropertyItem propertyItem)
            {
                property = propertyItem;
                Xceed.Wpf.Toolkit.CheckComboBox ccb = new Xceed.Wpf.Toolkit.CheckComboBox();

                for (int i = 0; i < 8; i++)
                {
                    ccb.Items.Add("OpCode" + i.ToString());
                }
                ccb.Name = property.DisplayName;
                ccb.Text = property.Value.ToString();
                ccb.ItemSelectionChanged += ccb_ItemSelectionChanged;
                return(ccb);
            }