forked from ClassIsland/ClassIsland
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTimeLineListItemAdorner.cs
55 lines (45 loc) · 1.27 KB
/
TimeLineListItemAdorner.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
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media;
namespace ClassIsland.Core;
public class TimeLineListItemAdorner : Adorner
{
private VisualCollection _visualCollection;
private Control _control ;
public TimeLineListItemAdorner(UIElement adornedElement, ControlTemplate template) : base(adornedElement)
{
_visualCollection = new VisualCollection(this);
_control = new Control()
{
Template = template,
ClipToBounds = false
};
ClipToBounds = false;
_visualCollection.Add(_control);
}
protected override void OnRender(DrawingContext drawingContext)
{
base.OnRender(drawingContext);
}
protected override int VisualChildrenCount
{
get
{
return _visualCollection.Count;
}
}
protected override Visual GetVisualChild(int index)
{
return _visualCollection[index];
}
protected override Size MeasureOverride(Size constraint)
{
return base.MeasureOverride(constraint);
}
protected override Size ArrangeOverride(Size finalSize)
{
_control.Arrange(new Rect(finalSize));
return base.ArrangeOverride(finalSize);
}
}