public void Options_Initialize(OptionsViewModel ovm) { // Monitored Folders ovm.MonitoredFolders.Clear(); foreach (var folder in Core.Data.UserData.MonitoredFolders) { var vm = new FolderViewModel() { Data = folder, IsVisible_DeleteButton = true, UpdateMonitoredFolders = () => Options_Initialize(ovm) }; ovm.MonitoredFolders.Add(vm); } // Destination Folder ovm.DestinationFolder = new FolderViewModel() { Data = new Folder() { FolderName = Core.Data.UserData.DestinationFolder } }; }
internal void Options_AddNewMonitoredFolder(OptionsViewModel ovm) { var vm = new FolderViewModel() { Data = new Folder(), UpdateMonitoredFolders = () => Options_Initialize(ovm) }; ovm.MonitoredFolders.Add(vm); }
internal void Options_DeleteMonitoredFolder(FolderViewModel vm) { var data = vm.Data; if (!Data.UserData.MonitoredFolders.Contains(data)) return; Data.UserData.MonitoredFolders.Remove(data); vm.UpdateMonitoredFolders?.Invoke(); }