private void serviceClient_GetCategoryConfigsCompleted(object sender, GetCategoryConfigsCompletedEventArgs e) { if (this.Window.FaultHandle.Handle(e)) { return; } if (e.Result.ResultList != null) { LogCategoryBody firstItem = new LogCategoryBody() { GlobalID = null, LocalID = null, CategoryName = null, CategoryDescription = CommonResource.ComboBox_ExtraAllText }; List <LogCategoryBody> list = e.Result.ResultList.ToList(); list.ForEach(item => item.CategoryDescription = item.CategoryName); list.Insert(0, firstItem); this.ddlCategory.ItemsSource = list; this.ddlCategory.IsEnabled = true; LogQueryModel queryModel = e.UserState as LogQueryModel; if (queryModel != null) { this.ddlCategory.SelectedValue = queryModel.CategoryName; } else { this.ddlCategory.SelectedIndex = 0; } } }
void QueryLogConfigClientGetCategoryConfigsCompleted(object sender, GetCategoryConfigsCompletedEventArgs e) { ButtonSearch.IsEnabled = true; if (Window.FaultHandle.Handle(e)) { return; } DataGridLogCategory.ItemsSource = e.Result.ResultList; DataGridLogCategory.TotalCount = e.Result.PagingInfo.TotalCount; if (!m_isLoaded && Request != null && Request.QueryString != null && Request.QueryString.Count > 0) { m_isLoaded = true; DataGridLogCategory.SelectedIndex = 0; m_selectedRadioButton = new RadioButton { DataContext = DataGridLogCategory.SelectedItem, IsChecked = true }; RadioButtonChecked(m_selectedRadioButton, null); ((QueryLogConfigService.LogCategoryBody)m_selectedRadioButton.DataContext).IsChecked = true; } if (m_selectedIdx > -1 && m_isUpdateLocalOrGlobal) { DataGridLogCategory.SelectedIndex = m_selectedIdx; if (DataGridLogCategory.SelectedItem != null) { ((QueryLogConfigService.LogCategoryBody)DataGridLogCategory.SelectedItem).IsChecked = true; } m_isUpdateLocalOrGlobal = false; } }