/*********************************************************************/
        /// <summary>
        /// Konstruktor, Initialisierung der Komponenten
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            mBusinessLogic = CBusinessLogic.getInstance();
            mBusinessLogic.init();
            mBusinessLogic.registerWindow(this);

            mTableEntryList = mBusinessLogic.getAllTableData();

            graph.DataContext = this;
            mGraph = mBusinessLogic.getGraph();
            
                
            GraphSharp.Algorithms.Layout.Simple.Tree.SimpleTreeLayoutParameters layoutParameter = new GraphSharp.Algorithms.Layout.Simple.Tree.SimpleTreeLayoutParameters();
            layoutParameter.LayerGap = 50;
            layoutParameter.VertexGap = 50;
            layoutParameter.Direction = LayoutDirection.TopToBottom;
                   
            LayoutAlgorithmType = "LinLog";
            graph.LayoutParameters = layoutParameter;
               
            DataContext = this;

            setTreeViewsEnabled(false);
            setViewVisibility(E_VIEW.E_TABLE_VIEW);
        }
        /*********************************************************************/
        /// <summary>
        /// Wird bei Klick auf einen Button für den Ansichtswechsel aufgerufen
        /// und führt Ansichtswechsel durch
        /// </summary>
        private void viewToggleButton_Checked(object sender, RoutedEventArgs e)
        {
            E_VIEW selectedView = E_VIEW.E_TABLE_VIEW;

            // Ansicht auf Tabellenansicht wechseln
            if (sender == viewTableBtn)
            {
                selectedView = E_VIEW.E_TABLE_VIEW;
            }
            // Ansicht auf Baum Interaktiv Ansicht wechseln
            else if (sender == viewTreeInteractivBtn)
            {
                selectedView = E_VIEW.E_TREE_INTERACTIVE_VIEW;
            }
            // Ansicht auf Baum Automatisch Ansicht wechseln
            else if (sender == viewTreeAutomaticBtn)
            {
                selectedView = E_VIEW.E_TREE_AUTOMATIC_VIEW;
            }

            setViewVisibility(selectedView);
            mBusinessLogic.changeView(selectedView);

            if ((selectedView == E_VIEW.E_TREE_INTERACTIVE_VIEW) || (selectedView == E_VIEW.E_TREE_AUTOMATIC_VIEW))
            {
                mGraph = mBusinessLogic.getGraph();
                NotifyPropertyChanged("VisualGraph");
                NotifyPropertyChanged("vertexTooltip");
            }

            graph.DataContext = this;
        }