MenuNameToPositionConverter.cs 717 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Globalization;
  3. using System.Windows.Data;
  4. namespace SWRIS.Converters
  5. {
  6. public class MenuNameToPositionConverter : IValueConverter
  7. {
  8. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  9. {
  10. var menuName = (string)value;
  11. switch (menuName)
  12. {
  13. case "Home":
  14. return 0;
  15. case "Record":
  16. return 157;
  17. }
  18. return 0;
  19. }
  20. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  21. {
  22. throw new NotImplementedException();
  23. }
  24. }
  25. }