Example #1
0
        private void DisplaySubmodel()
        {
            // show the edit panel
            OuterTabControl.SelectedItem = TabPanelEdit;

            // clear first
            ScrollViewerForm.Content = null;

            // test trivial access
            if (theOptions == null || theSubmodel == null)
            {
                return;
            }

            // identify the record
            // check for a record in options, that matches Submodel
            currentFormRecord = theOptions.MatchRecordsForSemanticId(theSubmodel.semanticId);
            if (currentFormRecord == null)
            {
                return;
            }

            // check form
            if (currentFormRecord.FormSubmodel == null || currentFormRecord.FormSubmodel.SubmodelElements == null)
            {
                return;
            }

            // initialize form
            formInUpdateMode     = true;
            updateSourceElements = theSubmodel.submodelElements;

            // take over existing data
            this.currentFormInst = new FormInstanceSubmodel(currentFormRecord.FormSubmodel);
            this.currentFormInst.InitReferable(currentFormRecord.FormSubmodel, theSubmodel);
            this.currentFormInst.PresetInstancesBasedOnSource(updateSourceElements);
            this.currentFormInst.outerEventStack = theEventStack;

            // bring it to the panel
            var elementsCntl = new FormListOfDifferentControl();

            elementsCntl.DataContext = this.currentFormInst;
            ScrollViewerForm.Content = elementsCntl;
        }