public SearchPage() { ViewData = new NijieSearchViewModel(); InitializeComponent(); #if DEBUG ViewData.Query = "無修正"; #endif this.DataContext = ViewData; }
private void ProcessNavigation(string fragment) { if (!String.IsNullOrWhiteSpace(fragment)) { if (this.ViewData == null) { ViewData = new NijieSearchViewModel(); } var uri = new Uri("http://localhost/?" + fragment); var query = System.Web.HttpUtility.ParseQueryString(uri.Query); ViewData.Query = query.Get("query"); SearchCommand.Execute(null, btnFetch); } }