comparison MetroWpf/MetroWpf.Xaml/Converters/EnumToIntConverter.cs @ 17:7721a1270363

New files added during dev
author stevenh7776 stevenhollidge@hotmail.com
date Wed, 14 Mar 2012 01:23:57 +0700
parents
children
comparison
equal deleted inserted replaced
16:2395908fa45b 17:7721a1270363
1 using System;
2 using System.Windows;
3 using System.Windows.Data;
4 using System.Windows.Markup;
5
6 namespace MetroWpf.Xaml.Converters
7 {
8 public class EnumToIntConverter : MarkupExtension, IValueConverter
9 {
10 private static EnumToIntConverter _enumToIntConverter = null;
11
12 public override object ProvideValue(IServiceProvider serviceProvider)
13 {
14 if (null == _enumToIntConverter)
15 _enumToIntConverter = new EnumToIntConverter();
16
17 return _enumToIntConverter;
18 }
19
20 #region IValueConverter Members
21
22 public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
23 {
24 return (int) value;
25 }
26
27 public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
28 {
29 throw new NotImplementedException();
30 }
31
32 #endregion
33 }
34 }