Exemplo n.º 1
0
        public SearchResultViewModel(SearchResult searchResult, string rootPath)
        {
            SearchResult = searchResult;
            string shortenedPath = SearchResult.FileInfo.FullName.Replace(rootPath, "");

            shortenedPath = shortenedPath.TrimStart(new char[] { '\\', '/' });
            File          = shortenedPath;
            State         = SearchResultState.InProgress;
        }
Exemplo n.º 2
0
        public async void PerformSearch(string parameter)
        {
            State = SearchResultState.Busy;
            await SubsonicService.Search(parameter)
            .WithErrorHandler(this)
            .OnSuccess(PopulateMenuItems)
            .Execute();

            State = MenuItemViewModels.Any() ? SearchResultState.ResultsFound : SearchResultState.NoResultsFound;
        }
Exemplo n.º 3
0
 public SearchViewModel()
 {
     MenuItemViewModels = new List <MenuItemViewModel>();
     State             = SearchResultState.NoResultsFound;
     UpdateDisplayName = () => DisplayName = string.Format("Searched for: \"{0}\"", Parameter ?? string.Empty);
 }
Exemplo n.º 4
0
        protected override Task AfterPopulate(string parameter)
        {
            State = MenuItems.Any() ? SearchResultState.ResultsFound : SearchResultState.NoResultsFound;

            return(Task.Factory.StartNew(() => { }));
        }
Exemplo n.º 5
0
 public override async Task Populate()
 {
     State = SearchResultState.Busy;
     await base.Populate();
 }
Exemplo n.º 6
0
 public SearchViewModel()
 {
     MenuItemViewModels = new List<MenuItemViewModel>();
     State = SearchResultState.NoResultsFound;
     UpdateDisplayName = () => DisplayName = string.Format("Searched for: \"{0}\"", Parameter ?? string.Empty);
 }
Exemplo n.º 7
0
        public async void PerformSearch(string parameter)
        {
            State = SearchResultState.Busy;
            await SubsonicService.Search(parameter)
                                 .WithErrorHandler(this)
                                 .OnSuccess(PopulateMenuItems)
                                 .Execute();

            State = MenuItemViewModels.Any() ? SearchResultState.ResultsFound : SearchResultState.NoResultsFound;
        }
 public SearchResultStateModel(SearchResultState searchResultState)
 {
     m_SearchResultState = searchResultState;
     RaisePropertyChanged("Items");
 }