-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathConverter.cs
More file actions
50 lines (41 loc) · 1.58 KB
/
Converter.cs
File metadata and controls
50 lines (41 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/// <Summary>
/// Author : R. Arun Mutharasu
/// Created :25-01-2022
/// YouTube Channel : C# Design Pro
/// </Summary>
using System;
using System.Globalization;
using System.Windows.Data;
namespace ResponsiveApp.Helper
{
// IsLessThanConverter //
public class IsLessThanConverter : IValueConverter
{
public static readonly IValueConverter Instance = new IsLessThanConverter();
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
double doubleValue = System.Convert.ToDouble(value);
double compareToValue = System.Convert.ToDouble(parameter);
return doubleValue < compareToValue;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
// IsGreaterThanConverter //
public class IsGreaterThanConverter : IValueConverter
{
public static readonly IValueConverter Instance = new IsGreaterThanConverter();
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
double doubleValue = System.Convert.ToDouble(value);
double compareToValue = System.Convert.ToDouble(parameter);
return doubleValue > compareToValue;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}