예제 #1
0
        private void methodBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            PropertiesVM vm = DataContext as PropertiesVM;

            if (e.AddedItems.Count > 0)
            {
                vm.MethodIndex = methodBox.SelectedIndex;
            }
        }
예제 #2
0
        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            PropertiesVM vm = DataContext as PropertiesVM;

            if (e.AddedItems.Count > 0)
            {
                ComboBoxItem item = e.AddedItems[0] as ComboBoxItem;
                vm.SetAngle(item.Content as string);
            }
        }
예제 #3
0
        private void a_TextChanged(object sender, TextChangedEventArgs e)
        {
            PropertiesVM vm = DataContext as PropertiesVM;

            ApplyButton.IsEnabled = !(
                a00.GetBindingExpression(TextBox.TextProperty).HasValidationError ||
                a01.GetBindingExpression(TextBox.TextProperty).HasValidationError ||
                a10.GetBindingExpression(TextBox.TextProperty).HasValidationError ||
                a11.GetBindingExpression(TextBox.TextProperty).HasValidationError ||
                vm.Matrix == null);
        }
        public TemplatesEditorVM(TECTemplates templatesManager)
        {
            manager         = templatesManager;
            Templates       = templatesManager.Templates;
            ScopeCollection = new ScopeCollectionsTabVM(templatesManager);
            MaterialsTab    = new MaterialVM(templatesManager);
            MaterialsTab.SelectionChanged += obj => {
                Selected = obj;
            };
            SystemHierarchyVM              = new SystemHierarchyVM(templatesManager, true);
            SystemHierarchyVM.Selected    += obj => { Selected = obj; };
            EquipmentHierarchyVM           = new EquipmentHierarchyVM(templatesManager);
            EquipmentHierarchyVM.Selected += obj => { Selected = obj; };
            SubScopeHierarchyVM            = new SubScopeHierarchyVM(templatesManager);
            SubScopeHierarchyVM.Selected  += obj => { Selected = obj; };

            MiscVM = new MiscCostsVM(templatesManager);
            MiscVM.SelectionChanged += obj => { Selected = obj; };

            PropertiesVM = new PropertiesVM(templatesManager.Catalogs, templatesManager);

            AddParameterCommand = new RelayCommand(AddParametersExecute);
        }
예제 #5
0
        private void addParam_Click(object sender, RoutedEventArgs e)
        {
            PropertiesVM vm = DataContext as PropertiesVM;

            vm.AddParam();
        }
        public override IDock CreateLayout()
        {
            var languagesVM = new LanguagesVM()
            {
                Id = nameof(LanguagesVM)
            };
            var propertiesVM = new PropertiesVM()
            {
                Id = nameof(PropertiesVM)
            };
            var executeVM = new ExecuteVM()
            {
                Id = nameof(ExecuteVM)
            };
            var resultListVM = new ResultListVM()
            {
                Id = nameof(ResultListVM)
            };

            var mainLayout = new ProportionalDock
            {
                Id               = DockableExplorerLocator.IdUniversalDock,
                Orientation      = Orientation.Horizontal,
                Proportion       = double.NaN,
                ActiveDockable   = null,
                VisibleDockables = CreateList <IDockable>
                                   (
                    new ProportionalDock
                {
                    Orientation      = Orientation.Vertical,
                    Proportion       = 0.8,
                    ActiveDockable   = null,
                    VisibleDockables = CreateList <IDockable>
                                       (
                        new DocumentDock
                    {
                        Id               = DockableExplorerLocator.IdResultsDock,
                        IsCollapsable    = false,
                        ActiveDockable   = null,
                        VisibleDockables = CreateList <IDockable>()
                    },
                        new SplitterDock(),
                        new ToolDock
                    {
                        Id               = DockableExplorerLocator.IdExecuteDock,
                        ActiveDockable   = executeVM,
                        Proportion       = 0.2,
                        VisibleDockables = CreateList <IDockable>(executeVM)
                    }
                                       )
                },
                    new SplitterDock(),
                    new ProportionalDock
                {
                    Orientation      = Orientation.Vertical,
                    Proportion       = double.NaN,
                    ActiveDockable   = null,
                    VisibleDockables = CreateList <IDockable>
                                       (
                        new ToolDock
                    {
                        Id =
                            DockableExplorerLocator.IdResultListDock +
                            " " +
                            DockableExplorerLocator.IdLanguagesDock,
                        ActiveDockable   = resultListVM,
                        VisibleDockables = CreateList <IDockable>(resultListVM, languagesVM)
                    },
                        new SplitterDock(),
                        new ToolDock
                    {
                        Id               = DockableExplorerLocator.IdPropertiesDock,
                        ActiveDockable   = propertiesVM,
                        VisibleDockables = CreateList <IDockable>(propertiesVM)
                    }
                                       )
                }
                                   )
            };

            var projectView = new ProjectViewportVM
            {
                Id               = "Project",
                Title            = "Project",
                ActiveDockable   = mainLayout,
                VisibleDockables = CreateList <IDockable>(mainLayout)
            };

            var root = CreateRootDock();

            root.ActiveDockable   = projectView;
            root.DefaultDockable  = projectView;
            root.VisibleDockables = CreateList <IDockable>(projectView);

            return(root);
        }
예제 #7
0
 public AddVM(TECScopeManager scopeManager)
 {
     IsTemplates  = scopeManager is TECTemplates;
     templates    = scopeManager as TECTemplates;
     PropertiesVM = new PropertiesVM(scopeManager.Catalogs, scopeManager);
 }