/// <summary>
        /// Handles the disposal of all items
        /// </summary>
        /// <param name="e">Event args</param>
        protected override void OnItemsCleared(ItemsClearedEventArgs <BaseDatabaseOptionsDataModel> e)
        {
            base.OnItemsCleared(e);

            // Clear the data grid
            SQLiteOptionsDataGrid.Clear();
            MySQLOptionsDataGrid.Clear();
            SQLServerOptionsDataGrid.Clear();
            PostgreSQLOptionsDataGrid.Clear();
        }
 /// <summary>
 /// Handles the removal of the specified <paramref name="options"/>
 /// </summary>
 /// <param name="options">The options</param>
 private void HandleRemoval(BaseDatabaseOptionsDataModel options)
 {
     if (options is SQLiteOptionsDataModel sqliteOptions)
     {
         SQLiteOptionsDataGrid.Remove(sqliteOptions);
     }
     else if (options is MySQLOptionsDataModel mysqlOptions)
     {
         MySQLOptionsDataGrid.Remove(mysqlOptions);
     }
     else if (options is SQLServerOptionsDataModel sqlServerOptions)
     {
         SQLServerOptionsDataGrid.Remove(sqlServerOptions);
     }
     else if (options is PostgreSQLOptionsDataModel postgreSQLOptions)
     {
         PostgreSQLOptionsDataGrid.Remove(postgreSQLOptions);
     }
 }
 /// <summary>
 /// Handles the addition of the specified <paramref name="options"/>
 /// </summary>
 /// <param name="options">The options</param>
 private void HandleAddition(BaseDatabaseOptionsDataModel options)
 {
     if (options is SQLiteOptionsDataModel sqliteOptions)
     {
         SQLiteOptionsDataGrid.Add(sqliteOptions);
     }
     else if (options is MySQLOptionsDataModel mysqlOptions)
     {
         MySQLOptionsDataGrid.Add(mysqlOptions);
     }
     else if (options is SQLServerOptionsDataModel sqlServerOptions)
     {
         SQLServerOptionsDataGrid.Add(sqlServerOptions);
     }
     else if (options is PostgreSQLOptionsDataModel postgreSQLOptions)
     {
         PostgreSQLOptionsDataGrid.Add(postgreSQLOptions);
     }
 }
        /// <summary>
        /// Creates and returns the GUI in a form of a <see cref="FrameworkElement"/>
        /// </summary>
        /// <returns></returns>
        protected override FrameworkElement CreateBaseGUIElement()
        {
            // Create the content stack panel
            ContentStackPanel = new StackPanel()
            {
                Orientation = Orientation.Vertical
            };

            #region SQLite

            // Create the SQLite stack panel collapsible vertical menu
            SQLiteStackPanelCollapsibleVerticalMenu = new StackPanelCollapsibleVerticalMenu <UIElement>()
            {
                IsOpen = true,
                Text   = "SQLite"
            };

            // Create the SQLite options data grid
            SQLiteOptionsDataGrid = CeidDiplomatikiDataModelHelpers.CreateDefaultSQLiteOptionsDataModelDataGrid();

            SQLiteOptionsDataGrid.ConfigureOptions((container, grid, row, model) =>
            {
                container.AddDeleteOption(async(button) => await RemoveOptionAsync(model));
            });


            SQLiteOptionsDataGrid.Margin = new Thickness(NormalUniformMargin);

            // Add it to the collapsible menu
            SQLiteStackPanelCollapsibleVerticalMenu.Add(SQLiteOptionsDataGrid);

            // Add the collapsible menu to the stack panel
            ContentStackPanel.Children.Add(SQLiteStackPanelCollapsibleVerticalMenu);

            #endregion

            #region MySQL

            // Create the MySQL stack panel collapsible vertical menu
            MySQLStackPanelCollapsibleVerticalMenu = new StackPanelCollapsibleVerticalMenu <UIElement>()
            {
                IsOpen = true,
                Text   = "MySQL"
            };

            // Create the MySQL options data grid
            MySQLOptionsDataGrid = CeidDiplomatikiDataModelHelpers.CreateDefaultMySQLOptionsDataModelDataGrid();

            MySQLOptionsDataGrid.ConfigureOptions((container, grid, row, model) =>
            {
                container.AddOpenOption(async(button) =>
                {
                    var provider = SQLDatabaseProvider.MySQL;

                    // Get the analyzer
                    var analyzer = CeidDiplomatikiDI.GetDatabaseAnalyzer(provider);

                    // Get the connection string
                    model.TryGetConnectionString(out var connectionString);

                    // Get the database
                    var database = analyzer.GetDatabases().First(x => x.DatabaseName == model.DatabaseName);

                    // Show the page
                    await WindowsControlsDI.GetWindowsDialogManager.OpenAsync(model.DatabaseName, IconPaths.DatabasePath, () =>
                    {
                        return(new QueryMapsPage(database, model));
                    }, connectionString);
                });
                container.AddDeleteOption(async(button) => await RemoveOptionAsync(model));
            });



            MySQLOptionsDataGrid.Margin = new Thickness(NormalUniformMargin);

            // Add it to the collapsible menu
            MySQLStackPanelCollapsibleVerticalMenu.Add(MySQLOptionsDataGrid);

            // Add the collapsible menu to the stack panel
            ContentStackPanel.Children.Add(MySQLStackPanelCollapsibleVerticalMenu);

            #endregion

            #region SQLServer

            // Create the SQLServer stack panel collapsible vertical menu
            SQLServerStackPanelCollapsibleVerticalMenu = new StackPanelCollapsibleVerticalMenu <UIElement>()
            {
                IsOpen = true,
                Text   = "SQLServer"
            };

            // Create the SQLServer options data grid
            SQLServerOptionsDataGrid = CeidDiplomatikiDataModelHelpers.CreateDefaultSQLServerOptionsDataModelDataGrid();

            SQLServerOptionsDataGrid.ConfigureOptions((container, grid, row, model) =>
            {
                container.AddDeleteOption(async(button) => await RemoveOptionAsync(model));
            });


            SQLServerOptionsDataGrid.Margin = new Thickness(NormalUniformMargin);

            // Add it to the collapsible menu
            SQLServerStackPanelCollapsibleVerticalMenu.Add(SQLServerOptionsDataGrid);

            // Add the collapsible menu to the stack panel
            ContentStackPanel.Children.Add(SQLServerStackPanelCollapsibleVerticalMenu);

            #endregion

            #region PostgreSQL

            // Create the PostgreSQL stack panel collapsible vertical menu
            PostgreSQLStackPanelCollapsibleVerticalMenu = new StackPanelCollapsibleVerticalMenu <UIElement>()
            {
                IsOpen = true,
                Text   = "PostgreSQL"
            };

            // Create the PostgreSQL options data grid
            PostgreSQLOptionsDataGrid = CeidDiplomatikiDataModelHelpers.CreateDefaultPostgreSQLOptionsDataModelDataGrid();

            PostgreSQLOptionsDataGrid.ConfigureOptions((container, grid, row, model) =>
            {
                container.AddDeleteOption(async(button) => await RemoveOptionAsync(model));
            });

            PostgreSQLOptionsDataGrid.Margin = new Thickness(NormalUniformMargin);

            // Add it to the collapsible menu
            PostgreSQLStackPanelCollapsibleVerticalMenu.Add(PostgreSQLOptionsDataGrid);

            // Add the collapsible menu to the stack panel
            ContentStackPanel.Children.Add(PostgreSQLStackPanelCollapsibleVerticalMenu);

            #endregion

            // Return the content stack panel
            return(ContentStackPanel);
        }