init
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace RegionOfInterestChannels
|
||||
{
|
||||
public class StateListIndexConverter : IMultiValueConverter
|
||||
{
|
||||
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
if (null == values || values.Length != 2)
|
||||
return null;
|
||||
|
||||
if (!(values[1] is int idx) || !(values[0] is IEnumerable<State> states) || states.Count() <= idx)
|
||||
return null;
|
||||
|
||||
return states.ElementAt(idx);
|
||||
}
|
||||
|
||||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user