public void AddFolder(FolderModel folderModel) { this._folderModel.Folders.Add(folderModel); FolderTreeViewModel newFolderViewModel = new FolderTreeViewModel(folderModel, this); _folderViewModelsCollection.Add(newFolderViewModel); }
public FolderTreeViewModel(FolderModel folderModel, FolderTreeViewModel parent) { _folderModel = folderModel; _parent = parent; _folderViewModelsCollection = new ObservableCollection <BaseTreeViewModel>( (from child in _folderModel.Folders select new FolderTreeViewModel(child, this)) .ToList()); }
public LoginTreeViewModel(LoginModel loginModel, FolderTreeViewModel folderTreeViewModel) { _loginModel = loginModel; _name = _loginModel.Name; _login = _loginModel.Login; _url = _loginModel.URL; _notes = _loginModel.Notes; _parentFolderTreeViewModel = folderTreeViewModel; OpenURL = new RelayCommand(x => OpenURLMethod(), x => URL.Length > 0 ? true : false); CopyPasswordToClipboard = new RelayCommand(x => this._loginModel.CopyPasswordToClipboard()); SaveDataToModel = new RelayCommand(x => SaveChanges(), x => unsavedChanges ? true : false); SetNewPassword = new RelayCommand(x => SetNewPasswordMethod()); }
public void DeleteFolder(FolderTreeViewModel folderTreeViewModel) { _folderModel.Folders.Remove(folderTreeViewModel._folderModel); _folderViewModelsCollection.Remove(folderTreeViewModel); }