public void GoHome() { // 되돌리기 위한 기록 History.RecordAll(Query, lastSearchedQuery, SearchResults, Definitions, SearchResultSelectedIndex, false, IsMoreButtonVisible); IsDefinitionViewerVisible = Visibility.Collapsed; RaisePropertyChanged("IsDefinitionViewerVisible", "CanGoBack", "CanGoForward"); // 검색어 지우기 Query = ""; // 검색 결과 지우기 SearchResults.Clear(); List <SearchResultItem> homeTab = SearchResultStaticPage.GetHomeTab(); foreach (SearchResultItem item in homeTab) { SearchResults.Add(item); } SearchResultSelectedIndex = 0; Definitions = WordDetailStaticPage.GetHomepage(HandleHyperlinkClick, HandleRecentWordClick); IsDefinitionViewerVisible = Visibility.Visible; RaisePropertyChanged("Query", "SearchResultSelectedIndex", "Definitions", "IsDefinitionViewerVisible"); }
public SearchViewModel(ref bool IsFirstPageOpen, Action searchBoxFocus) { this.IsWidthBigEnough = true; this.History = new HistoryManager(); this.SearchBoxFocus = searchBoxFocus; this.IsMasterProgressBarVisible = Visibility.Collapsed; this.Query = ""; this.IsSearchBoxEnabled = true; this.IsMoreButtonVisible = Visibility.Collapsed; this.IsErrorMessageVisible = Visibility.Collapsed; this.IsDetailProgressBarVisible = Visibility.Collapsed; this.IsDefinitionViewerVisible = Visibility.Collapsed; this.IsDetailGridVisible = Visibility.Visible; if (IsFirstPageOpen) { this.SearchResults = new ObservableCollection <SearchResultItem>(SearchResultStaticPage.GetHomeTab()); this.Definitions = WordDetailStaticPage.GetHomepage(HandleHyperlinkClick, HandleRecentWordClick); this.IsDefinitionViewerVisible = Visibility.Visible; this.SearchResultSelectedIndex = 0; IsFirstPageOpen = false; } else { this.SearchResults = new ObservableCollection <SearchResultItem>(); this.Definitions = new WordDetailItem(HandleHyperlinkClick); this.SearchResultSelectedIndex = -1; } }