private void OnUserAutoCompleteBoxPopulating(object sender, PopulatingEventArgs e) { var acb = sender as AutoCompleteBox; if (acb != null) { var context = new SystemUserDomainContext(); context.SearchUser(e.Parameter, (obj) => { if (Utility.Utility.CheckInvokeOperation(obj)) { acb.ItemsSource = obj.Value; } }, null); } }
private void OnSearchUserButtonClick(object sender, RoutedEventArgs e) { if (!string.IsNullOrEmpty(txtSearchKey.Text)) { BusyIndicator1.IsBusy = true; BusyIndicator1.BusyContent = "正在查询..."; userContext.SearchUser(txtSearchKey.Text, (obj) => { BusyIndicator1.IsBusy = false; if (Utility.Utility.CheckInvokeOperation(obj)) { SysUserGrid.ItemsSource = obj.Value; SysUserPager.Source = obj.Value; } }, null); } }