This repository has been archived by the owner on Sep 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VerticalLineHelper.cs
64 lines (57 loc) · 2.25 KB
/
VerticalLineHelper.cs
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using DevExpress.Xpf.Grid;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
using System.Windows.Media;
namespace WpfApplication48
{
public class VerticalLineHelper
{
public static double GetLineThickness(DependencyObject obj)
{
return (double)obj.GetValue(LineThicknessProperty);
}
public static void SetLineThickness(DependencyObject obj, double value)
{
obj.SetValue(LineThicknessProperty, value);
}
public static Brush GetLineColor(DependencyObject obj)
{
return (Brush)obj.GetValue(LineColorProperty);
}
public static void SetLineColor(DependencyObject obj, Brush value)
{
obj.SetValue(LineColorProperty, value);
}
public static readonly DependencyProperty LineThicknessProperty =
DependencyProperty.RegisterAttached("LineThickness", typeof(double), typeof(VerticalLineHelper), new PropertyMetadata(0.0));
public static readonly DependencyProperty LineColorProperty =
DependencyProperty.RegisterAttached("LineColor", typeof(Brush), typeof(VerticalLineHelper), new PropertyMetadata(Brushes.Black));
}
public class VerticalLineThicknessConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return new Thickness(0, 0, (double)value, 0);
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
public class VerticalLineVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return (value != null) && (value is GridColumn || value is GridControlBand);
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}