private void InitUIList() { appLog.Info("InitUIList..."); needAddList = new ObservableCollection <SalaryInfo>(); needUpdateList = new ObservableCollection <SalaryInfo>(); //添加雇员选择列表 appLog.Info("Add EmployeeList..."); AlgorithmClass.InitSalarySelectionList(dataManager.AllSalaryList, dataManager.AllEmployeeList, dataManager.AllDepartmentList, AlgorithmClass.GetWorkStatusList()); AllSalaryList = AlgorithmClass.DeepClone <ObservableCollection <SalaryInfo> >(dataManager.AllSalaryList); lcv = new ListCollectionView(AllSalaryList); lcv.GroupDescriptions.Add(new PropertyGroupDescription("DepartmentName")); lcv.Filter = Fitter_TextChanged; lcv.Refresh(); //刷新当前页面上的所有收支 // FlushCurrentViewAllCommission(); AddBtn.SetBinding(Button.IsEnabledProperty, new Binding("IsEmpty") { Source = lcv }); ClearBtn.SetBinding(Button.IsEnabledProperty, new Binding("IsEmpty") { Source = lcv, Converter = new BoolConverter() }); SaveBtn.SetBinding(Button.IsEnabledProperty, new Binding("IsEmpty") { Source = lcv, Converter = new BoolConverter() }); RestoreBtn.SetBinding(Button.IsEnabledProperty, new Binding("IsEmpty") { Source = lcv, Converter = new BoolConverter() }); ViewBSBtn.SetBinding(Button.IsEnabledProperty, new Binding("IsEmpty") { Source = lcv, Converter = new BoolConverter() }); PrintBtn.SetBinding(Button.IsEnabledProperty, new Binding("IsEmpty") { Source = lcv, Converter = new BoolConverter() }); FlushAllBtn.SetBinding(Button.IsEnabledProperty, new Binding("IsEmpty") { Source = lcv, Converter = new BoolConverter() }); SalaryDataGrid.ItemsSource = lcv; }