private void BTN_Delete_Card_Click(object sender, RoutedEventArgs e)
        {
            //This does basically the same thing to a card as Delete_Set does to a whole set
            //We need to ensure this is something the user wishes to do
            InputDialog input = new InputDialog("Are You Sure You Want To Delete This Card?\nThis Action Cannot Be Undone!\n(y/n)");

            if (input.ShowDialog() == true)
            {
                if (input.Answer().ToLower() == "y" && CMB_Card_Selector.SelectedItem != null)
                {
                    Static_Methods_Container.Clear_Text_Boxes(this);
                    //First we will need the card object out of the selected item
                    Card target = (Card)((ComboBoxItem)CMB_Card_Selector.SelectedItem).Tag;
                    //This card contains the fileinfo we can use to delete the file
                    FileInfo info = target.Text_File;
                    if (info.Exists)
                    {
                        info.Delete();
                    }
                    //We then remove the selected card from the selected sets list
                    //First we need to extract the list of cards from the selected set to remove from
                    List <Card> current_set = ((Set_Info)((ComboBoxItem)CMB_Set_Selector.SelectedItem).Tag).cards;
                    //Remove the target card from this list
                    current_set.Remove(target);
                    //Lastly Delete the entry on the combo box since it references nothing
                    CMB_Card_Selector.Items.RemoveAt(CMB_Card_Selector.SelectedIndex);
                }
            }
        }
 private void CMB_Card_Selector_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     //First we need to clear the textboxes
     Static_Methods_Container.Clear_Text_Boxes(this);
     //and then if the new selection has a functional Card in the tag update the textboxes with this new data
     if (CMB_Card_Selector.SelectedItem != null && (Card)((ComboBoxItem)CMB_Card_Selector.SelectedItem).Tag != null)
     {
         //Fill the textboxes
         Card card = (Card)((ComboBoxItem)CMB_Card_Selector.SelectedItem).Tag;
         Static_Methods_Container.Populate_Text_Boxes(this, card);
     }
 }
 private void CMB_Set_Selector_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     //When the set drop down gets changed, the card list needs to be updated to represent the new set selected
     //Start by changing the selected Card in the combo box to an empty box
     CMB_Card_Selector.SelectedIndex = -1;
     //Empty The Text Boxes of any content
     Static_Methods_Container.Clear_Text_Boxes(this);
     //And Empty the card list
     CMB_Card_Selector.Items.Clear();
     //get the set from the selected item if they exist
     if (CMB_Set_Selector.SelectedItem != null && (Set_Info)((ComboBoxItem)CMB_Set_Selector.SelectedItem).Tag != null)
     {
         ComboBoxItem New_Selection = (ComboBoxItem)CMB_Set_Selector.SelectedItem;
         List <Card>  cards         = ((Set_Info)(New_Selection.Tag)).cards;
         //and repopulate the card drop down with those cards
         Static_Methods_Container.Populate_Card_List(this, cards);
     }
 }
        private void BTN_Delete_Set_Click(object sender, RoutedEventArgs e)
        {
            //This will target and delete the directory of the selected item assuming a prompt is passed
            InputDialog input = new InputDialog("Are You Sure You Want To Delete The Selected Set?\nThis Action Cannot Be Undone!\n(y/n)");

            if (input.ShowDialog() == true)
            {
                if (input.Answer().ToLower() == "y" && CMB_Set_Selector.SelectedItem != null)
                {
                    //Can't delete what doesnt exist obviously
                    Static_Methods_Container.Clear_Text_Boxes(this);
                    CMB_Card_Selector.SelectedIndex = -1;
                    CMB_Card_Selector.Items.Clear();
                    //We need to get the directory from the currently selected set
                    Set_Info info = (Set_Info)((ComboBoxItem)CMB_Set_Selector.SelectedItem).Tag;
                    //And use the directory to delete the whole directory
                    //the true at the end indicates recursive delete so as to delete contents as well
                    Directory.Delete(info.dir, true);
                    //Lastly we Remove the currently selected item from the list since it holds nothing anymore
                    CMB_Set_Selector.Items.RemoveAt(CMB_Set_Selector.SelectedIndex);
                }
            }
        }