Example #1
0
 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;
         }
     }
 }
Example #2
0
 private bool CanSave(object file)
 {
     if (file is FileViewModel)
     {
         return((file as FileViewModel).Type != FileTypesConstants.Other && !FileVMLogic.IsFileExistsInDb(file as FileViewModel));
     }
     return(false);
 }
Example #3
0
 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;
         }
     }
 }
Example #4
0
 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
     };
 }
Example #5
0
 public void SaveFile(object parameter)
 {
     FileVMLogic.SaveFileToDB(file, (int)parameter);
 }
Example #6
0
 private void Play(object file)
 {
     FileVMLogic.SetMediaSource(file as FileViewModel);
 }