aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch/Converters/ColumnToColumnIndexConverter.cs
blob: 474789e4f9cd5943e7cfab1c42ed88eaaf1df197 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Data;
using Tango.Touch.Controls;

namespace Tango.Touch.Converters
{
    public class ColumnToColumnIndexConverter : IMultiValueConverter
    {
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            ObservableCollection<LightTouchDataGridColumn> columns = values[0] as ObservableCollection<LightTouchDataGridColumn>;
            LightTouchDataGridColumn c = values[1] as LightTouchDataGridColumn;

            var a = columns.IndexOf(c);
            return a;
        }

        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}