RolePermissionEdit.xaml.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. namespace MECF.Framework.UI.Core.Accounts
  4. {
  5. /// <summary>
  6. /// Interaction logic for RolePermissionEdit.xaml
  7. /// </summary>
  8. public partial class RolePermissionEdit : Window
  9. {
  10. public RolePermissionEdit()
  11. {
  12. InitializeComponent();
  13. DataContext = roleViewModel;
  14. Loaded += new RoutedEventHandler(RolePermissionEdit_Loaded);
  15. roleViewModel.InitialRolePermissionVM();
  16. }
  17. void RolePermissionEdit_Loaded(object sender, RoutedEventArgs e)
  18. {
  19. //if (comboRoles.SelectedItem == null) { MessageBox.Show("请选择需要编辑的角色"); return; }
  20. roleViewModel.CurrentRoleName = comboRoles.SelectedValue + "";
  21. roleViewModel.BindAll();
  22. }
  23. RolePermissionViewModel roleViewModel = new RolePermissionViewModel();
  24. private void comboRoles_SelectionChanged(object sender, SelectionChangedEventArgs e)
  25. {
  26. string newrole = comboRoles.SelectedValue+"";
  27. if (!string.IsNullOrEmpty(newrole))
  28. roleViewModel.SelectRoleChanged(newrole);
  29. }
  30. }
  31. }