|
123456789101112131415161718192021222324252627 |
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Data;
-
- namespace BPASmartClient.MorkCL.Converter
- {
- /// <summary>
- /// 为ItemsControl添加行号。
- /// </summary>
- public class IndexConverter:IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- int index = (int)value + 1;
- return index.ToString().PadLeft(2, '0');
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- }
|