qamp/Qrakhen.Qamp.Editor/Converters/LineCountConverter.cs

27 lines
679 B
C#

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Windows.Data;
namespace Qrakhen.Qamp.Editor.Converters;
public class LineCountConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is int count) {
var counts = new int[count];
for (int i = 0; ++i <= count;)
counts[i - 1] = i;
return counts;
}
return new int[0];
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}