| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using System;
- using System.Collections.Generic;
- using System.Globalization;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Data;
- namespace ivf_tl_Operate.Converts
- {
- public class ConvertButtonIsEnable : IMultiValueConverter
- {
- public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
- {
- try
- {
- if (values.Count() != 2)
- {
- return false;
- }
- var a = values[0];
- var b = values[1];
- if (a == null || b == null)
- {
- return false;
- }
- int selectIndex = int.Parse(a.ToString());
- int ItemsCount = int.Parse(b.ToString());
- if (parameter.ToString() == "1")//上一页和第一页
- {
- if (selectIndex > 0)
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- else
- {
- if (selectIndex < (ItemsCount - 1))
- {
- return true;
- }
- else
- {
- return false;
- }
- }
- }
- catch (Exception)
- {
- return false;
- }
- }
- public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- }
|