Guest User

Untitled

a guest
Apr 22nd, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. 'converters' is an undeclared prefix. Line 8, position 14.
  2.  
  3. <?xml version="1.0" encoding="utf-8" ?>
  4. <ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
  5. xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  6. x:Class="Historation.Views.NewPartPage"
  7. xmlns:converter="clr-namespace:App.Converter">
  8. <ContentPage.Resources>
  9. <ResourceDictionary>
  10. <converters:IntEnumConverter x:Key="IntEnum"/> //<- error on this line
  11. </ResourceDictionary>
  12. </ContentPage.Resources>
  13.  
  14. namespace App.Converter
  15. {
  16. public class IntEnumConverter : IValueConverter
  17. {
  18. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  19. {
  20. if (value is Enum)
  21. {
  22. return (int)value;
  23. }
  24. return 0;
  25. }
  26.  
  27. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  28. {
  29. if (value is int)
  30. {
  31. return Enum.ToObject(targetType, value);
  32. }
  33. return 0;
  34. }
  35. }
  36. }
Add Comment
Please, Sign In to add comment