Пример #1
0
        //public IActionResult Index()
        //{
        //    return View();
        //}

        //       public List<ArtModel> GetAllArts()
        public ViewResult GetAllArts()
        {
            //   return "All pieces of art";
            var Data = _artRepository.GetAllArt();

            return(View());
        }
Пример #2
0
        public AddSongViewModel()
        {
            _artRepo       = new ArtRepository();
            _artCollection = new ObservableCollection <string>(_artRepo.GetAllArt());

            _songRepo = new SongRepository();

            AddNewSongCommand = new RelayCommand(new Action <object>(AddNewSong), Predicate => {
                if (TitleRule.TitleRegex.IsMatch(Title) &&
                    TitleRule.TitleRegex.IsMatch(Artist) &&
                    DurationRule.DurationRegex.IsMatch(Duration) &&
                    RequiredRule.RequiredRegex.IsMatch(SongPath))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            });
            CloseAddNewSongViewCommand = new RelayCommand(new Action <object>(CloseNewSongView));
            BrowseSongCommand          = new RelayCommand(new Action <object>(BrowseSong));
        }