Exemple #1
0
 public void UnregisterFlyout(IFlyoutProvider flyoutProvider)
 {
     if (_flyoutProviders.Contains(flyoutProvider))
     {
         _flyoutProviders.Remove(flyoutProvider);
     }
 }
Exemple #2
0
 public void RegisterFlyout(IFlyoutProvider flyoutProvider)
 {
     if (!_flyoutProviders.Contains(flyoutProvider))
     {
         _flyoutProviders.Add(flyoutProvider);
     }
 }
Exemple #3
0
        public MainViewModel(IFlyoutProvider flyoutProviderArgument, SynchronizationContext synchonizationContextArgument)
        {
            flyoutProvider         = flyoutProviderArgument;
            synchronizationContext = synchonizationContextArgument;
            invitesTable           = App.MobileService.GetTable <Invite>();
            itemsTable             = App.MobileService.GetTable <Item>();
            profilesTable          = App.MobileService.GetTable <Profile>();
            listMembersTable       = App.MobileService.GetTable <ListMember>();
            devicesTable           = App.MobileService.GetTable <Device>();
            settingsTable          = App.MobileService.GetTable <Setting>();

            SetupCommands();
            LoadSettingsAsync();
        }
        public ViewInvitesViewModel(MainViewModel mainViewModelParent, IMobileServiceTable<Invite> mobileServiceInvitesTable)
        {
            flyoutProvider = mainViewModelParent.FlyoutProvider;
            parent = mainViewModelParent;
            invitesTable = mobileServiceInvitesTable;
            Invites = parent.Invites;

            AcceptCommand = new DelegateCommand<Invite>(async invite =>
            {
                invite.IsApproved = true;
                await ProcessInvite(invite);
                parent.LoadListsAsync();
            });

            RejectCommand = new DelegateCommand<Invite>(async invite =>
            {
                await ProcessInvite(invite);
            });
        }
Exemple #5
0
        public ViewInvitesViewModel(MainViewModel mainViewModelParent, IMobileServiceTable <Invite> mobileServiceInvitesTable)
        {
            flyoutProvider = mainViewModelParent.FlyoutProvider;
            parent         = mainViewModelParent;
            invitesTable   = mobileServiceInvitesTable;
            Invites        = parent.Invites;

            AcceptCommand = new DelegateCommand <Invite>(async invite =>
            {
                invite.IsApproved = true;
                await ProcessInvite(invite);
                parent.LoadListsAsync();
            });

            RejectCommand = new DelegateCommand <Invite>(async invite =>
            {
                await ProcessInvite(invite);
            });
        }
        public MainViewModel(IFlyoutProvider flyoutProviderArgument, SynchronizationContext synchonizationContextArgument)
        {
            flyoutProvider = flyoutProviderArgument;
            synchronizationContext = synchonizationContextArgument;
            invitesTable = App.MobileService.GetTable<Invite>();
            itemsTable = App.MobileService.GetTable<Item>();
            profilesTable = App.MobileService.GetTable<Profile>();
            listMembersTable = App.MobileService.GetTable<ListMember>();
            devicesTable = App.MobileService.GetTable<Device>();
            settingsTable = App.MobileService.GetTable<Setting>();

            SetupCommands();
            LoadSettingsAsync();
        }
Exemple #7
0
        public DisplayRenderHints DisplayOrEditVisualAasxElement(
            PackageCentral packages,
            ListOfVisualElementBasic entities,
            bool editMode, bool hintMode = false, bool showIriMode = false,
            VisualElementEnvironmentItem.ConceptDescSortOrder?cdSortOrder = null,
            IFlyoutProvider flyoutProvider         = null,
            IPushApplicationEvent appEventProvider = null,
            DispEditHighlight.HighlightFieldInfo hightlightField = null)
        {
            //
            // Start
            //

            // hint mode disable, when not edit
            hintMode = hintMode && editMode;

            // remember objects for UI thread / redrawing
            this._packages            = packages;
            this._theEntities         = entities;
            _helper.packages          = packages;
            _helper.highlightField    = hightlightField;
            _helper.appEventsProvider = appEventProvider;

            // primary access
            var renderHints = new DisplayRenderHints();

            if (theMasterPanel == null || entities == null || entities.Count < 1)
            {
                renderHints.showDataPanel = false;
                return(renderHints);
            }

#if MONOUI
            var stack = ClearDisplayDefautlStack();
#else
            var stack = new AnyUiStackPanel();
#endif

            // create display context for WPF
            _displayContext     = new AnyUiDisplayContextWpf(flyoutProvider, packages);
            _helper.levelColors = DispLevelColors.GetLevelColorsFromOptions(Options.Curr);

            // modify repository
            ModifyRepo repo = null;
            if (editMode)
            {
                // some functionality still uses repo != null to detect editMode!!
                repo = new ModifyRepo();
            }
            _helper.editMode    = editMode;
            _helper.hintMode    = hintMode;
            _helper.repo        = repo;
            _helper.showIriMode = showIriMode;
            _helper.context     = _displayContext;

            // inform plug that their potential panel might not shown anymore
            Plugins.AllPluginsInvoke("clear-panel-visual-extension");

            //
            // Test for Blazor
            //
#if __test_blazor
            if (false)
            {
                var lab = new AnyUiLabel();
                lab.Content    = "Hallo";
                lab.Foreground = AnyUiBrushes.DarkBlue;
                stack.Children.Add(lab);

                if (editMode)
                {
                    var tb = new AnyUiTextBox();
                    tb.Foreground = AnyUiBrushes.Black;
                    tb.Text       = "Initial";
                    stack.Children.Add(tb);
                    repo.RegisterControl(tb, (o) =>
                    {
                        Log.Singleton.Info($"Text changed to .. {""+o}");
                        return(new AnyUiLambdaActionNone());
                    });

                    var btn = new AnyUiButton();
                    btn.Content = "Click me!";
                    stack.Children.Add(btn);
                    repo.RegisterControl(btn, (o) =>
                    {
                        Log.Singleton.Error("Button clicked!");
                        return(new AnyUiLambdaActionRedrawAllElements(null));
                    });
                }
            }
#endif

            var inhibitRenderStackToPanel = false;

            if (entities.ExactlyOne)
            {
                //
                // Dispatch: ONE item
                //
                var entity = entities.First();

                // maintain parent. If in doubt, set null
                ListOfVisualElement.SetParentsBasedOnChildHierarchy(entity);

                //
                // Dispatch
                //

                if (entity is VisualElementEnvironmentItem veei)
                {
                    _helper.DisplayOrEditAasEntityAasEnv(
                        packages, veei.theEnv, veei, editMode, stack, hintMode: hintMode);
                }
                else if (entity is VisualElementAdminShell veaas)
                {
                    _helper.DisplayOrEditAasEntityAas(
                        packages, veaas.theEnv, veaas.theAas, editMode, stack, hintMode: hintMode);
                }
                else if (entity is VisualElementAsset veas)
                {
                    _helper.DisplayOrEditAasEntityAsset(
                        packages, veas.theEnv, veas.theAsset, editMode, repo, stack, hintMode: hintMode);
                }
                else if (entity is VisualElementSubmodelRef vesmref)
                {
                    // data
                    AdminShell.AdministrationShell aas = null;
                    if (vesmref.Parent is VisualElementAdminShell xpaas)
                    {
                        aas = xpaas.theAas;
                    }

                    // edit
                    _helper.DisplayOrEditAasEntitySubmodelOrRef(
                        packages, vesmref.theEnv, aas, vesmref.theSubmodelRef, vesmref.theSubmodel, editMode, stack,
                        hintMode: hintMode);
                }
                else if (entity is VisualElementSubmodel vesm && vesm.theSubmodel != null)
                {
                    _helper.DisplayOrEditAasEntitySubmodelOrRef(
                        packages, vesm.theEnv, null, null, vesm.theSubmodel, editMode, stack,
                        hintMode: hintMode);
                }
                else if (entity is VisualElementSubmodelElement vesme)
                {
                    _helper.DisplayOrEditAasEntitySubmodelElement(
                        packages, vesme.theEnv, vesme.theContainer, vesme.theWrapper, vesme.theWrapper.submodelElement,
                        editMode,
                        repo, stack, hintMode: hintMode,
                        nestedCds: cdSortOrder.HasValue &&
                        cdSortOrder.Value == VisualElementEnvironmentItem.ConceptDescSortOrder.BySme);
                }
                else if (entity is VisualElementOperationVariable vepv)
                {
                    _helper.DisplayOrEditAasEntityOperationVariable(
                        packages, vepv.theEnv, vepv.theContainer, vepv.theOpVar, editMode,
                        stack, hintMode: hintMode);
                }
                else if (entity is VisualElementConceptDescription vecd)
                {
                    _helper.DisplayOrEditAasEntityConceptDescription(
                        packages, vecd.theEnv, null, vecd.theCD, editMode, repo, stack, hintMode: hintMode,
                        preventMove: cdSortOrder.HasValue &&
                        cdSortOrder.Value != VisualElementEnvironmentItem.ConceptDescSortOrder.None);
                }
                else if (entity is VisualElementView vevw)
                {
                    if (vevw.Parent != null && vevw.Parent is VisualElementAdminShell xpaas)
                    {
                        _helper.DisplayOrEditAasEntityView(
                            packages, vevw.theEnv, xpaas.theAas, vevw.theView, editMode, stack,
                            hintMode: hintMode);
                    }
                    else
                    {
                        _helper.AddGroup(stack, "View is corrupted!", _helper.levelColors.MainSection);
                    }
                }
                else if (entity is VisualElementReference verf)
                {
                    if (verf.Parent != null && verf.Parent is VisualElementView xpev)
                    {
                        _helper.DisplayOrEditAasEntityViewReference(
                            packages, verf.theEnv, xpev.theView, (AdminShell.ContainedElementRef)verf.theReference,
                            editMode, stack);
                    }
                    else
                    {
                        _helper.AddGroup(stack, "Reference is corrupted!", _helper.levelColors.MainSection);
                    }
                }
                else
                if (entity is VisualElementSupplementalFile vesf)
                {
                    _helper.DisplayOrEditAasEntitySupplementaryFile(packages, vesf.theFile, editMode, stack);
                }
                else if (entity is VisualElementPluginExtension vepe)
                {
                    // create controls
                    object result = null;

                    try
                    {
                        // replace at top level
                        theMasterPanel.Children.Clear();
                        if (vepe.thePlugin != null)
                        {
                            result = vepe.thePlugin.InvokeAction(
                                "fill-panel-visual-extension", vepe.thePackage, vepe.theReferable, theMasterPanel);
                        }
                    }
                    catch (Exception ex)
                    {
                        AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex);
                    }

                    // add?
                    if (result == null)
                    {
                        // re-init display!
#if MONOUI
                        stack = ClearDisplayDefautlStack();
#else
                        stack = new AnyUiStackPanel();
#endif

                        // helping message
                        _helper.AddGroup(
                            stack, "Entity from Plugin cannot be rendered!", _helper.levelColors.MainSection);
                    }
                    else
                    {
                        // this is natively done; do NOT render Any UI to WPF
                        inhibitRenderStackToPanel = true;
                    }

                    // show no panel nor scroll
                    renderHints.scrollingPanel = false;
                    renderHints.showDataPanel  = false;
                }
                else
                {
                    _helper.AddGroup(stack, "Entity is unknown!", _helper.levelColors.MainSection);
                }
            }
Exemple #8
0
        private void Import(ExportTableRecord job,
                            IFlyoutProvider fop,
                            AdminShell.Submodel sm, AdminShell.AdministrationShellEnv env)
        {
            // get the import file
            var dlg = new Microsoft.Win32.OpenFileDialog();

            try
            {
                dlg.InitialDirectory = System.IO.Path.GetDirectoryName(
                    System.AppDomain.CurrentDomain.BaseDirectory);
            }
            catch (Exception ex)
            {
                AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex);
            }
            dlg.Title = "Select text file to be exported";

            if (job.Format == (int)ExportTableRecord.FormatEnum.TSF)
            {
                dlg.DefaultExt = "*.txt";
                dlg.Filter     =
                    "Tab separated file (*.txt)|*.txt|Tab separated file (*.tsf)|*.tsf|All files (*.*)|*.*";
            }
            if (job.Format == (int)ExportTableRecord.FormatEnum.LaTex)
            {
                dlg.DefaultExt = "*.tex";
                dlg.Filter     = "LaTex file (*.tex)|*.tex|All files (*.*)|*.*";
            }
            if (job.Format == (int)ExportTableRecord.FormatEnum.Excel)
            {
                dlg.DefaultExt = "*.xlsx";
                dlg.Filter     = "Microsoft Excel (*.xlsx)|*.xlsx|All files (*.*)|*.*";
            }
            if (job.Format == (int)ExportTableRecord.FormatEnum.Word)
            {
                dlg.DefaultExt = "*.docx";
                dlg.Filter     = "Microsoft Word (*.docx)|*.docx|All files (*.*)|*.*";
            }

            fop?.StartFlyover(new EmptyFlyout());
            var res = dlg.ShowDialog(fop?.GetWin32Window());

            fop?.CloseFlyover();

            if (true != res)
            {
                return;
            }

            // try import
            try
            {
                Log.Info("Importing table: {0}", dlg.FileName);
                var success = false;
                try
                {
                    if (job.Format == (int)ExportTableRecord.FormatEnum.Word)
                    {
                        success = true;
                        var pop = new ImportPopulateByTable(Log, job, sm, env, options);
                        using (var stream = File.Open(dlg.FileName, FileMode.Open,
                                                      FileAccess.Read, FileShare.ReadWrite))
                            foreach (var tp in ImportTableWordProvider.CreateProviders(stream))
                            {
                                pop.PopulateBy(tp);
                            }
                    }

                    if (job.Format == (int)ExportTableRecord.FormatEnum.Excel)
                    {
                        success = true;
                        var pop = new ImportPopulateByTable(Log, job, sm, env, options);
                        foreach (var tp in ImportTableExcelProvider.CreateProviders(dlg.FileName))
                        {
                            pop.PopulateBy(tp);
                        }
                    }
                }
                catch (Exception ex)
                {
                    Log?.Error(ex, "importing table");
                    success = false;
                }

                if (!success)
                {
                    fop?.MessageBoxFlyoutShow(
                        "Some error occured while importing the table. Please refer to the log messages.",
                        "Error", AnyUiMessageBoxButton.OK, AnyUiMessageBoxImage.Exclamation);
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex, "When exporting table, an error occurred");
            }
        }
Exemple #9
0
        private void Export(ExportTableRecord job,
                            IFlyoutProvider fop,
                            AdminShell.Submodel sm, AdminShell.AdministrationShellEnv env)
        {
            // prepare list of items to be exported
            var list = new List <ExportTableAasEntitiesList>();

            ExportTable_EnumerateSubmodel(list, env, broadSearch: false,
                                          actInHierarchy: job.ActInHierarchy, depth: 1, sm: sm, sme: null);

            // get the output file
            var dlg = new Microsoft.Win32.SaveFileDialog();

            try
            {
                dlg.InitialDirectory = System.IO.Path.GetDirectoryName(
                    System.AppDomain.CurrentDomain.BaseDirectory);
            }
            catch (Exception ex)
            {
                AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex);
            }
            dlg.Title = "Select text file to be exported";

            if (job.Format == (int)ExportTableRecord.FormatEnum.TSF)
            {
                dlg.FileName   = "new.txt";
                dlg.DefaultExt = "*.txt";
                dlg.Filter     =
                    "Tab separated file (*.txt)|*.txt|Tab separated file (*.tsf)|*.tsf|All files (*.*)|*.*";
            }
            if (job.Format == (int)ExportTableRecord.FormatEnum.LaTex)
            {
                dlg.FileName   = "new.tex";
                dlg.DefaultExt = "*.tex";
                dlg.Filter     = "LaTex file (*.tex)|*.tex|All files (*.*)|*.*";
            }
            if (job.Format == (int)ExportTableRecord.FormatEnum.Excel)
            {
                dlg.FileName   = "new.xlsx";
                dlg.DefaultExt = "*.xlsx";
                dlg.Filter     = "Microsoft Excel (*.xlsx)|*.xlsx|All files (*.*)|*.*";
            }
            if (job.Format == (int)ExportTableRecord.FormatEnum.Word)
            {
                dlg.FileName   = "new.docx";
                dlg.DefaultExt = "*.docx";
                dlg.Filter     = "Microsoft Word (*.docx)|*.docx|All files (*.*)|*.*";
            }

            fop?.StartFlyover(new EmptyFlyout());
            var res = dlg.ShowDialog(fop?.GetWin32Window());

            fop?.CloseFlyover();

            try
            {
                if (res == true)
                {
                    Log.Info("Exporting table: {0}", dlg.FileName);
                    var success = false;
                    try
                    {
                        if (job.Format == (int)ExportTableRecord.FormatEnum.TSF)
                        {
                            success = job.ExportTabSeparated(dlg.FileName, list);
                        }
                        if (job.Format == (int)ExportTableRecord.FormatEnum.LaTex)
                        {
                            success = job.ExportLaTex(dlg.FileName, list);
                        }
                        if (job.Format == (int)ExportTableRecord.FormatEnum.Excel)
                        {
                            success = job.ExportExcel(dlg.FileName, list);
                        }
                        if (job.Format == (int)ExportTableRecord.FormatEnum.Word)
                        {
                            success = job.ExportWord(dlg.FileName, list);
                        }
                    }
                    catch (Exception ex)
                    {
                        Log.Error(ex, "performing data format export");
                        success = false;
                    }

                    if (!success)
                    {
                        fop?.MessageBoxFlyoutShow(
                            "Some error occured while exporting the table. Please refer to the log messages.",
                            "Error", AnyUiMessageBoxButton.OK, AnyUiMessageBoxImage.Exclamation);
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Error(ex, "When exporting table, an error occurred");
            }
        }
Exemple #10
0
        public DisplayRenderHints DisplayOrEditVisualAasxElement(
            PackageCentral packages,
            ListOfVisualElementBasic entities,
            bool editMode, bool hintMode = false, bool showIriMode = false,
            VisualElementEnvironmentItem.ConceptDescSortOrder?cdSortOrder = null,
            IFlyoutProvider flyoutProvider         = null,
            IPushApplicationEvent appEventProvider = null,
            DispEditHighlight.HighlightFieldInfo hightlightField = null)
        {
            //
            // Start
            //

            // hint mode disable, when not edit
            hintMode = hintMode && editMode;

            // remember objects for UI thread / redrawing
            this._packages            = packages;
            this._theEntities         = entities;
            _helper.packages          = packages;
            _helper.highlightField    = hightlightField;
            _helper.appEventsProvider = appEventProvider;

            // primary access
            var renderHints = new DisplayRenderHints();

            if (theMasterPanel == null || entities == null || entities.Count < 1)
            {
                renderHints.showDataPanel = false;
                return(renderHints);
            }

#if MONOUI
            var stack = ClearDisplayDefautlStack();
#else
            var stack = new AnyUiStackPanel();
#endif

            // create display context for WPF
            _displayContext     = new AnyUiDisplayContextWpf(flyoutProvider, packages);
            _helper.levelColors = DispLevelColors.GetLevelColorsFromOptions(Options.Curr);

            // modify repository
            ModifyRepo repo = null;
            if (editMode)
            {
                // some functionality still uses repo != null to detect editMode!!
                repo = new ModifyRepo();
            }
            _helper.editMode    = editMode;
            _helper.hintMode    = hintMode;
            _helper.repo        = repo;
            _helper.showIriMode = showIriMode;
            _helper.context     = _displayContext;

            //
            // Test for Blazor
            //
#if __test_blazor
            if (false)
            {
                var lab = new AnyUiLabel();
                lab.Content    = "Hallo";
                lab.Foreground = AnyUiBrushes.DarkBlue;
                stack.Children.Add(lab);

                if (editMode)
                {
                    var tb = new AnyUiTextBox();
                    tb.Foreground = AnyUiBrushes.Black;
                    tb.Text       = "Initial";
                    stack.Children.Add(tb);
                    repo.RegisterControl(tb, (o) =>
                    {
                        Log.Singleton.Info($"Text changed to .. {""+o}");
                        return(new AnyUiLambdaActionNone());
                    });

                    var btn = new AnyUiButton();
                    btn.Content = "Click me!";
                    stack.Children.Add(btn);
                    repo.RegisterControl(btn, (o) =>
                    {
                        Log.Singleton.Error("Button clicked!");
                        return(new AnyUiLambdaActionRedrawAllElements(null));
                    });
                }
            }
#endif

            var inhibitRenderStackToPanel = false;

            if (entities.ExactlyOne)
            {
                //
                // Dispatch: ONE item
                //
                var entity = entities.First();

                if (entity is VisualElementEnvironmentItem veei)
                {
                    _helper.DisplayOrEditAasEntityAasEnv(
                        packages, veei.theEnv, veei, editMode, stack, hintMode: hintMode);
                }
                else if (entity is VisualElementAdminShell veaas)
                {
                    _helper.DisplayOrEditAasEntityAas(
                        packages, veaas.theEnv, veaas.theAas, editMode, stack, hintMode: hintMode);
                }
                else if (entity is VisualElementAsset veas)
                {
                    _helper.DisplayOrEditAasEntityAsset(
                        packages, veas.theEnv, veas.theAsset, editMode, repo, stack, hintMode: hintMode);
                }
                else if (entity is VisualElementSubmodelRef vesmref)
                {
                    AdminShell.AdministrationShell aas = null;
                    if (vesmref.Parent is VisualElementAdminShell xpaas)
                    {
                        aas = xpaas.theAas;
                    }
                    _helper.DisplayOrEditAasEntitySubmodelOrRef(
                        packages, vesmref.theEnv, aas, vesmref.theSubmodelRef, vesmref.theSubmodel, editMode, stack,
                        hintMode: hintMode);
                }
                else if (entity is VisualElementSubmodel vesm)
                {
                    _helper.DisplayOrEditAasEntitySubmodelOrRef(
                        packages, vesm.theEnv, null, null, vesm.theSubmodel, editMode, stack,
                        hintMode: hintMode);
                }
                else if (entity is VisualElementSubmodelElement vesme)
                {
                    _helper.DisplayOrEditAasEntitySubmodelElement(
                        packages, vesme.theEnv, vesme.theContainer, vesme.theWrapper, vesme.theWrapper.submodelElement,
                        editMode,
                        repo, stack, hintMode: hintMode,
                        nestedCds: cdSortOrder.HasValue &&
                        cdSortOrder.Value == VisualElementEnvironmentItem.ConceptDescSortOrder.BySme);
                }
                else if (entity is VisualElementOperationVariable vepv)
                {
                    _helper.DisplayOrEditAasEntityOperationVariable(
                        packages, vepv.theEnv, vepv.theContainer, vepv.theOpVar, editMode,
                        stack, hintMode: hintMode);
                }
                else if (entity is VisualElementConceptDescription vecd)
                {
                    _helper.DisplayOrEditAasEntityConceptDescription(
                        packages, vecd.theEnv, null, vecd.theCD, editMode, repo, stack, hintMode: hintMode,
                        preventMove: cdSortOrder.HasValue &&
                        cdSortOrder.Value != VisualElementEnvironmentItem.ConceptDescSortOrder.None);
                }
                else if (entity is VisualElementView vevw)
                {
                    if (vevw.Parent != null && vevw.Parent is VisualElementAdminShell xpaas)
                    {
                        _helper.DisplayOrEditAasEntityView(
                            packages, vevw.theEnv, xpaas.theAas, vevw.theView, editMode, stack,
                            hintMode: hintMode);
                    }
                    else
                    {
                        _helper.AddGroup(stack, "View is corrupted!", _helper.levelColors.MainSection);
                    }
                }
                else if (entity is VisualElementReference verf)
                {
                    if (verf.Parent != null && verf.Parent is VisualElementView xpev)
                    {
                        _helper.DisplayOrEditAasEntityViewReference(
                            packages, verf.theEnv, xpev.theView, (AdminShell.ContainedElementRef)verf.theReference,
                            editMode, stack);
                    }
                    else
                    {
                        _helper.AddGroup(stack, "Reference is corrupted!", _helper.levelColors.MainSection);
                    }
                }
                else
                if (entity is VisualElementSupplementalFile vesf)
                {
                    _helper.DisplayOrEditAasEntitySupplementaryFile(packages, vesf.theFile, editMode, stack);
                }
                else if (entity is VisualElementPluginExtension vepe)
                {
                    // create controls
                    object result = null;

                    try
                    {
                        // replace at top level
                        theMasterPanel.Children.Clear();
                        if (vepe.thePlugin != null)
                        {
                            result = vepe.thePlugin.InvokeAction(
                                "fill-panel-visual-extension", vepe.thePackage, vepe.theReferable, theMasterPanel);
                        }
                    }
                    catch (Exception ex)
                    {
                        AdminShellNS.LogInternally.That.SilentlyIgnoredError(ex);
                    }

                    // add?
                    if (result == null)
                    {
                        // re-init display!
#if MONOUI
                        stack = ClearDisplayDefautlStack();
#else
                        stack = new AnyUiStackPanel();
#endif

                        // helping message
                        _helper.AddGroup(
                            stack, "Entity from Plugin cannot be rendered!", _helper.levelColors.MainSection);
                    }
                    else
                    {
                        // this is natively done; do NOT render Any UI to WPF
                        inhibitRenderStackToPanel = true;
                    }

                    // show no panel nor scroll
                    renderHints.scrollingPanel = false;
                    renderHints.showDataPanel  = false;
                }
                else
                {
                    _helper.AddGroup(stack, "Entity is unknown!", _helper.levelColors.MainSection);
                }
            }
            else
            {
                //
                // Dispatch: MULTIPLE items
                //
                _helper.DisplayOrEditAasEntityMultipleElements(packages, entities, editMode, stack, cdSortOrder);
            }

            // now render master stack
#if __export_BLAZOR
            var fn = @"fileEdit.json";
            if (!editMode)
            {
                count = 0;
                var jsonSerializerSettings = new JsonSerializerSettings()
                {
                    TypeNameHandling = TypeNameHandling.All,
                    Formatting       = Formatting.Indented
                };
                var json = JsonConvert.SerializeObject(stack, jsonSerializerSettings);
                System.IO.File.WriteAllText(fn, json);
            }
            if (editMode)
            {
                if (true && count == 2)
                {
                    count = 0;
                    JsonSerializerSettings settings = new JsonSerializerSettings
                    {
                        // SerializationBinder = new DisplayNameSerializationBinder(
                        //    new[] { typeof(AasxIntegrationBase.AasForms.FormDescListOfElement),
                        //      typeof(AasxIntegrationBase.AasForms.FormDescProperty) }),
                        // SerializationBinder = new DisplayNameSerializationBinder(
                        //     new[] { typeof(AnyUiStackPanel), typeof(AnyUiUIElement) }),
                        // NullValueHandling = NullValueHandling.Ignore,
                        ReferenceLoopHandling = ReferenceLoopHandling.Error,
                        TypeNameHandling      = TypeNameHandling.All,
                        Formatting            = Formatting.Indented
                    };

                    //if (stack is AnyUiPanel pan)
                    //{
                    //    for (int i = 0; i < pan.Children.Count; i++)
                    //    {
                    //        var json = JsonConvert.SerializeObject(pan.Children[i], settings);
                    //        System.IO.File.WriteAllText(fn+"."+i, json);
                    //    }
                    //}
                    var json = JsonConvert.SerializeObject(stack, settings);
                    System.IO.File.WriteAllText(fn, json);
                }
                count++;

                /*
                 * var writer = new System.Xml.Serialization.XmlSerializer(typeof(AnyUiUIElement));
                 * var wfile = new System.IO.StreamWriter(@"c:\development\fileEdit.xml");
                 * writer.Serialize(wfile, stack);
                 * wfile.Close();
                 */
            }
#endif
#if MONOUI
#else
            // render Any UI to WPF?
            if (!inhibitRenderStackToPanel)
            {
                // rendering
                theMasterPanel.Children.Clear();
                var spwpf = _displayContext.GetOrCreateWpfElement(stack);
                _helper.ShowLastHighlights();
                DockPanel.SetDock(spwpf, Dock.Top);
                theMasterPanel.Children.Add(spwpf);

                // register key shortcuts
                var num = _displayContext.PrepareNameList(stack);
                if (num > 0)
                {
                    _displayContext.RegisterKeyShortcut(
                        "aas-elem-move-up", ModifierKeys.Shift | ModifierKeys.Control, Key.Up,
                        "Move current AAS element up by one position.");

                    _displayContext.RegisterKeyShortcut(
                        "aas-elem-move-down", ModifierKeys.Shift | ModifierKeys.Control, Key.Down,
                        "Move current AAS element down by one position.");

                    _displayContext.RegisterKeyShortcut(
                        "aas-elem-move-top", ModifierKeys.Shift | ModifierKeys.Control, Key.Home,
                        "Move current AAS element to the first position of the respective list.");

                    _displayContext.RegisterKeyShortcut(
                        "aas-elem-move-end", ModifierKeys.Shift | ModifierKeys.Control, Key.End,
                        "Move current AAS element to the last position of the respective list.");

                    _displayContext.RegisterKeyShortcut(
                        "aas-elem-delete", ModifierKeys.Shift | ModifierKeys.Control, Key.Delete,
                        "Delete current AAS element in the respective list. Shift key skips dialogue.");

                    _displayContext.RegisterKeyShortcut(
                        "aas-elem-cut", ModifierKeys.Shift | ModifierKeys.Control, Key.X,
                        "Transfers current AAS element into paste buffer and deletes in respective list.");

                    _displayContext.RegisterKeyShortcut(
                        "aas-elem-copy", ModifierKeys.Shift | ModifierKeys.Control, Key.C,
                        "Copies current AAS element into paste buffer for later pasting.");

                    _displayContext.RegisterKeyShortcut(
                        "aas-elem-paste-into", ModifierKeys.Shift | ModifierKeys.Control, Key.V,
                        "Copy existing paste buffer into the child list of the current AAS element.");

                    _displayContext.RegisterKeyShortcut(
                        "aas-elem-paste-above", ModifierKeys.Shift | ModifierKeys.Control, Key.W,
                        "Copy existing paste buffer above the current AAS element in the same list.");

                    _displayContext.RegisterKeyShortcut(
                        "aas-elem-paste-below", ModifierKeys.Shift | ModifierKeys.Control, Key.Y,
                        "Copy existing paste buffer below the current AAS element in the same list.");
                }
            }

            // keep the stack
            _lastRenderedRootElement = stack;
#endif

            // return render hints
            return(renderHints);
        }