//remove the save path from the selected TvcFiles's savepath collection
        private void DeleteSavePathButton_Click(object sender, RoutedEventArgs e)
        {
            Button  sendingButton = (Button)sender;
            TvcFile selectedFile  = (TvcFile)FilesListView.SelectedItem;

            selectedFile.SavePaths.Remove((string)sendingButton.DataContext);
        }
        //removes the TvcFile from the collection
        private void DeleteFileButton_Click(object sender, RoutedEventArgs e)
        {
            Button  sendingButton   = (Button)sender;
            TvcFile selectedTvcFile = (TvcFile)sendingButton.DataContext;

            filesCollection.Remove(selectedTvcFile);
        }
        //creates a new save location and adds it to the TvcFiles's savepath collection
        private void AddNewSaveButton_Click(object sender, RoutedEventArgs e)
        {
            CommonOpenFileDialog folderDialog = new CommonOpenFileDialog();

            folderDialog.IsFolderPicker = true;
            CommonFileDialogResult result = folderDialog.ShowDialog();

            if (result == CommonFileDialogResult.Ok)
            {
                TvcFile selectedFile = (TvcFile)FilesListView.SelectedItem;

                selectedFile.SavePaths.Add(folderDialog.FileName);
            }
        }
        //shows the save paths of the selected TvcFile
        private void FilesListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            TvcFile selectedItem = (TvcFile)FilesListView.SelectedItem;

            if (selectedItem == null)
            {
                SelectedFileGrid.Visibility = Visibility.Hidden;
            }
            else
            {
                SelectedFileGrid.DataContext = selectedItem;
                SelectedFileGrid.Visibility  = Visibility.Visible;
            }
        }
        //creates a new TvcFile and adds it to the collection
        private void AddNewFileButton_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog
            {
                Multiselect = false
            };

            openFileDialog.ShowDialog();

            if (openFileDialog.FileName != "")
            {
                TvcFile tvcFile = new TvcFile()
                {
                    FilePath      = openFileDialog.FileName,
                    FileNameFull  = openFileDialog.SafeFileName,
                    TimerInterval = 10,
                    SavePaths     = { System.IO.Path.ChangeExtension(openFileDialog.FileName, null) + " -- Version History" }
                };

                filesCollection.Add(tvcFile);
                FilesListView.SelectedItem = tvcFile;
            }
        }