RolesConverter.cs 875 B

12345678910111213141516171819202122232425262728
  1. using MECF.Framework.Common.Account.Extends;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows.Data;
  8. namespace FurnaceUI.Converter
  9. {
  10. public class RolesConverter : IValueConverter
  11. {
  12. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  13. {
  14. if (value == null)
  15. return string.Empty;
  16. var roles =new List<Role>((value as List<Role>).ToArray());
  17. roles.RemoveAll(x => x.RoleName == "Logoff");
  18. return roles;
  19. }
  20. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  21. {
  22. throw new NotImplementedException();
  23. }
  24. }
  25. }