private void BindModuleTree(SysRole role) { if (myRadDataForm.Mode == RadDataFormMode.Edit) { var modules = RoleLogic.ModuleProcessOfRole(role.ID); RadTreeView tv = this.GetMPTreeView(); IList mtis = tv.ItemsSource as IList; foreach (ModuleTreeItem mti in mtis) { SetChildrenModulesChecked(modules, mti, tv); } tv.CollapseAll();//设置好之后全部收缩 } }