public ProjectFilesViewModel(ObservableCollection <ProjectFileViewModel> assemblyFiles, ObservableCollection <ProjectFileViewModel> cFiles)
        {
            AssemblyFiles = assemblyFiles;
            CFiles        = cFiles;

            ShowAddMenu = new RelayCommand(() =>
            {
                CurrentAddFile = new ProjectFileViewModel(this);
                IsAddingFile   = true;
            });

            ApplyAddMenuToAssembly = new RelayCommand(() =>
            {
                CurrentAddFile.IsAssemblyFile = true;
                AssemblyFiles.Add(CurrentAddFile);
                IsAddingFile = false;
            });

            ApplyAddMenuToC = new RelayCommand(() =>
            {
                CFiles.Add(CurrentAddFile);
                IsAddingFile = false;
            });

            // Implement a way of keeping track of whether we've made changes to the project or not.
            PropertyChanged += (s, e) =>
                               Backend.UnsavedChangesMade = true;
        }
        public static ProjectFilesViewModel FromData(ProjectFiles files)
        {
            var newAssembly = new ObservableCollection <ProjectFileViewModel>();
            var newC        = new ObservableCollection <ProjectFileViewModel>();

            // Create a new view model to give back.
            var newProjFiles = new ProjectFilesViewModel(newAssembly, newC);

            // Convert each item to the correct type - for both assembly and C files.
            for (int i = 0; i < files.AssemblyFiles.Count; i++)
            {
                newAssembly.Add(ProjectFileViewModel.FromData(files.AssemblyFiles[i], newProjFiles, true));
            }
            for (int i = 0; i < files.CFiles.Count; i++)
            {
                newC.Add(ProjectFileViewModel.FromData(files.CFiles[i], newProjFiles, false));
            }

            // Update the project files and return it.
            return(newProjFiles);
        }