annotate MetroWpf/MetroWpf.Xaml/Converters/EnumToIntConverter.cs @ 100:9b6855dc165e

Updated System.Windows into Libs
author stevenhollidge <stevenhollidge@hotmail.com>
date Sat, 05 May 2012 23:04:16 +0100
parents 7721a1270363
children
rev   line source
17
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
1 using System;
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
2 using System.Windows;
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
3 using System.Windows.Data;
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
4 using System.Windows.Markup;
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
5
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
6 namespace MetroWpf.Xaml.Converters
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
7 {
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
8 public class EnumToIntConverter : MarkupExtension, IValueConverter
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
9 {
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
10 private static EnumToIntConverter _enumToIntConverter = null;
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
11
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
12 public override object ProvideValue(IServiceProvider serviceProvider)
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
13 {
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
14 if (null == _enumToIntConverter)
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
15 _enumToIntConverter = new EnumToIntConverter();
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
16
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
17 return _enumToIntConverter;
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
18 }
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
19
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
20 #region IValueConverter Members
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
21
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
22 public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
23 {
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
24 return (int) value;
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
25 }
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
26
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
27 public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
28 {
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
29 throw new NotImplementedException();
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
30 }
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
31
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
32 #endregion
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
33 }
7721a1270363 New files added during dev
stevenh7776 stevenhollidge@hotmail.com
parents:
diff changeset
34 }