public void TabSelected(object obj) { if ((int)obj == 0) { if (!String.IsNullOrEmpty(CatalogPath)) { SelectedValue = FileVMLogic.GetFiles(CatalogPath); } else { SelectedValue = null; } } else { if (CategoryId != 0) { SelectedValue = FileVMLogic.GetFiles(CategoryId); } else { SelectedValue = null; } } }
private bool CanSave(object file) { if (file is FileViewModel) { return((file as FileViewModel).Type != FileTypesConstants.Other && !FileVMLogic.IsFileExistsInDb(file as FileViewModel)); } return(false); }
public void SelectedCatalog(object obj) { if (obj is string) { CatalogPath = obj.ToString(); SelectedValue = FileVMLogic.GetFiles(CatalogPath); } else { if (obj is int) { CategoryId = (int)obj; SelectedValue = FileVMLogic.GetFiles(CategoryId); } else { SelectedValue = null; } } }
public MainWindowViewModel() { Collapse = new Command(CollapseElement); Visible = new Command(VisibleElement); Media = new MediaViewModel(); Trees = new TreeViewModel() { CatalogPath = Properties.Settings.Default.CatalogPath, SelectedValue = FileVMLogic.GetFiles(Properties.Settings.Default.CatalogPath), CategoryId = Properties.Settings.Default.CategoryId }; }
public void SaveFile(object parameter) { FileVMLogic.SaveFileToDB(file, (int)parameter); }
private void Play(object file) { FileVMLogic.SetMediaSource(file as FileViewModel); }