12345678910111213141516171819202122232425 |
- using System;
- using System.Windows.Data;
-
- namespace ComeCapture.Converters
- {
- public class SizeConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- return parameter != null && value != null && int.Parse(value.ToString()) == int.Parse(parameter.ToString());
- }
-
- public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- if ((bool)value)
- {
- return parameter;
- }
- else
- {
- return null;
- }
- }
- }
- }
|