private void OnEnable()
        {
            if (DisplaySpline.SplineData == null)
            {
                return;
            }

            toolbars = new List <SceneGUIToolbar>();

            foreach (GX_Data.SplineData.Base data in DisplaySpline.SplineData.Base)
            {
                List <string> contents = new List <string>();
                contents.Add(string.Format("{0} {1}", "Merge from last", data.RuntimeData.mergeFromLast));

                ToolbarContent tab = new ToolbarContent(data.RuntimeDataAddress.ToString(), contents.ToArray());

                toolbars.Add(new SceneGUIToolbar(Camera.main, data.RuntimeData.startPosition, 240, new ToolbarContent[] { tab }));
            }
        }
        /* =============
         * = FUNCTIONS =
         * =============
         */



        private void SetMessenger()
        {
            Messenger.Default.Register <SMSNotification>(this, async(notification) =>
            {
                await DispatcherHelper.ExecuteOnUIThreadAsync(async() =>
                {
                    try
                    {
                        switch (notification.Type)
                        {
                        case TypeUpdateModule.ModuleDeleted:
                            RemoveModule(notification.ID);
                            ModulesPinned.RemoveModule(notification.ID);
                            break;

                        case TypeUpdateModule.NewModule:
                            await AddModule(notification.ID);
                            break;

                        case TypeUpdateModule.UpdateModule:
                            break;
                        }
                    }
                    catch { }
                });
            });

            Messenger.Default.Register <ModulesPinnedNotification>(this, async(notification) =>
            {
                await DispatcherHelper.ExecuteOnUIThreadAsync(async() =>
                {
                    try
                    {
                        switch (notification.Modification)
                        {
                        case ModulesPinedModification.Added:
                            await AddModule(notification.ID);
                            break;

                        case ModulesPinedModification.Removed:
                            RemoveModule(notification.ID);
                            break;
                        }
                    }
                    catch { }
                });
            });

            Messenger.Default.Register <EditorViewNotification>(this, async(notification_ui) =>
            {
                await DispatcherHelper.ExecuteOnUIThreadAsync(() =>
                {
                    try
                    {
                        SetTheme();
                    }
                    catch { }
                });
            });

            Messenger.Default.Register <ToolbarNotification>(this, async(notification_toolbar) =>
            {
                await DispatcherHelper.ExecuteOnUIThreadAsync(() =>
                {
                    try
                    {
                        StackPanel widget = (StackPanel)ToolbarContent.FindName("" + notification_toolbar.id);

                        switch (notification_toolbar.propertie)
                        {
                        case ToolbarProperties.ButtonEnabled:
                            ((Button)widget.FindName(notification_toolbar.uiElementName + notification_toolbar.id)).IsEnabled = (bool)notification_toolbar.content;
                            break;

                        case ToolbarProperties.IsButtonEnabled when !notification_toolbar.answerNotification:
                            Button element = (Button)widget.FindName(notification_toolbar.uiElementName + notification_toolbar.id);
                            Messenger.Default.Send(new ToolbarNotification {
                                id = notification_toolbar.id, uiElementName = notification_toolbar.uiElementName, propertie = ToolbarProperties.IsButtonEnabled, answerNotification = true, content = element.IsEnabled
                            });
                            break;

                        case ToolbarProperties.SetTextBoxContent:
                            ((TextBox)widget.FindName(notification_toolbar.uiElementName + notification_toolbar.id)).Text = (string)notification_toolbar.content;
                            break;

                        case ToolbarProperties.GetTextBoxContent when !notification_toolbar.answerNotification:
                            TextBox elementb = (TextBox)widget.FindName(notification_toolbar.uiElementName + notification_toolbar.id);
                            Messenger.Default.Send(new ToolbarNotification {
                                id = notification_toolbar.id, guid = notification_toolbar.guid, uiElementName = notification_toolbar.uiElementName, propertie = ToolbarProperties.GetTextBoxContent, answerNotification = true, content = elementb.Text
                            });
                            break;

                        case ToolbarProperties.OpenFlyout:
                            UIElement UIElement = (UIElement)widget.FindName(notification_toolbar.uiElementName + notification_toolbar.id);
                            Flyout FlyoutElement;

                            if (UIElement.ContextFlyout == null)
                            {
                                FlyoutElement           = new Flyout();
                                ModuleHTMLView HTMLView = new ModuleHTMLView();
                                HTMLView.Height         = 300; HTMLView.Width = 300;

                                HTMLView.LoadPage((string)notification_toolbar.content, notification_toolbar.id);
                                FlyoutElement.Content = HTMLView; FlyoutElement.FlyoutPresenterStyle = (Style)Application.Current.Resources["FlyoutBorderless"];

                                UIElement.ContextFlyout = FlyoutElement;
                                UIElement.ContextFlyout.ShowAt(UIElement as FrameworkElement);
                            }
                            else
                            {
                                if ((string)notification_toolbar.content != "")
                                {
                                    FlyoutElement = (UIElement.ContextFlyout as Flyout);
                                    (FlyoutElement.Content as ModuleHTMLView).LoadPage((string)notification_toolbar.content, notification_toolbar.id);
                                }

                                UIElement.ContextFlyout.ShowAt(UIElement as FrameworkElement);
                            }

                            break;
                        }
                    }
                    catch { }
                });
            });
        }
 private void RemoveModule(string ID)
 => ToolbarContent.Children.Remove((UIElement)ToolbarContent.FindName("" + ID));
 private void RemoveModule(int ID)
 {
     ToolbarContent.Children.Remove((UIElement)ToolbarContent.FindName("" + ID));
 }