protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { string by; if (NavigationContext.QueryString.TryGetValue("by", out by)) { switch (by) { case "mango": _topGrid.Visibility = System.Windows.Visibility.Collapsed; _searchType = UserSearchLoadContext.UserSearchType.Email; // for now I'm just scanning e-mail, a better impl. // would do a phone scan as well. PageTitle = "via contacts"; Watermark = string.Empty; TaskType = null; StartMangoSearching(); // Scope = ...; break; case "twitter": _searchType = UserSearchLoadContext.UserSearchType.TwitterSource; PageTitle = "on Twitter"; Watermark = "enter your twitter name"; TaskType = null; Scope = CreateInputScope(InputScopeNameValue.EmailUserName); break; case "name": _searchType = UserSearchLoadContext.UserSearchType.Name; PageTitle = "by name"; Watermark = "friend's name"; TaskType = null; Scope = CreateInputScope(InputScopeNameValue.PersonalFullName); break; case "email": _searchType = UserSearchLoadContext.UserSearchType.Email; PageTitle = "by email"; Watermark = "friend's email"; TaskType = "email"; Scope = CreateInputScope(InputScopeNameValue.EmailNameOrAddress); break; case "phone": _searchType = UserSearchLoadContext.UserSearchType.Phone; PageTitle = "by phone"; Watermark = "phone number"; TaskType = "phone"; Scope = CreateInputScope(InputScopeNameValue.TelephoneNumber); break; } } DataContext = this; object o; if (State.TryGetValue("query", out o)) { _searchedFor = o as string; if (!string.IsNullOrEmpty(_searchedFor)) { Search(_searchedFor); } } else if (_taskResultOk && _search.Text.Length > 0) { _searchedFor = _search.Text; Search(_searchedFor); } base.OnNavigatedTo(e); }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { string by; if (NavigationContext.QueryString.TryGetValue("by", out by)) { switch (by) { case "mango": _topGrid.Visibility = System.Windows.Visibility.Collapsed; _searchType = UserSearchLoadContext.UserSearchType.Email; // for now I'm just scanning e-mail, a better impl. // would do a phone scan as well. PageTitle = "via contacts"; Watermark = string.Empty; TaskType = null; StartMangoSearching(); // Scope = ...; break; case "twitter": _searchType = UserSearchLoadContext.UserSearchType.TwitterSource; PageTitle = "on Twitter"; Watermark = "enter your twitter name"; TaskType = null; Scope = CreateInputScope(InputScopeNameValue.EmailUserName); break; case "name": _searchType = UserSearchLoadContext.UserSearchType.Name; PageTitle = "by name"; Watermark = "friend's name"; TaskType = null; Scope = CreateInputScope(InputScopeNameValue.PersonalFullName); break; case "email": _searchType = UserSearchLoadContext.UserSearchType.Email; PageTitle = "by email"; Watermark = "friend's email"; TaskType = "email"; Scope = CreateInputScope(InputScopeNameValue.EmailNameOrAddress); break; case "phone": _searchType = UserSearchLoadContext.UserSearchType.Phone; PageTitle = "by phone"; Watermark = "phone number"; TaskType = "phone"; Scope = CreateInputScope(InputScopeNameValue.TelephoneNumber); break; } } DataContext = this; object o; if (State.TryGetValue("query", out o)) { _searchedFor = o as string; if (!string.IsNullOrEmpty(_searchedFor)) { Search(_searchedFor); } } else if (_taskResultOk && _search.Text.Length > 0) { _searchedFor = _search.Text; Search(_searchedFor); } base.OnNavigatedTo(e); }