Files

49 lines
1.1 KiB
C#
Raw Permalink Normal View History

2017-02-18 00:15:59 +03:00
using System.ComponentModel;
using System.Windows;
2017-01-09 13:25:52 +03:00
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media;
namespace BrightSharp.Diagrams
2017-01-09 13:25:52 +03:00
{
2017-02-18 00:15:59 +03:00
[ToolboxItem(false)]
2017-01-09 13:25:52 +03:00
public class ResizeRotateAdorner : Adorner
{
private VisualCollection visuals;
private ResizeRotateChrome chrome;
protected override int VisualChildrenCount
{
get
{
return visuals.Count;
2017-01-09 13:25:52 +03:00
}
}
public ResizeRotateAdorner(ContentControl designerItem)
: base(designerItem)
{
SnapsToDevicePixels = true;
chrome = new ResizeRotateChrome();
chrome.DataContext = designerItem;
visuals = new VisualCollection(this);
visuals.Add(chrome);
Focusable = true;
2017-01-09 13:25:52 +03:00
}
protected override Size ArrangeOverride(Size arrangeBounds)
{
chrome.Arrange(new Rect(arrangeBounds));
2017-01-09 13:25:52 +03:00
return arrangeBounds;
}
protected override Visual GetVisualChild(int index)
{
return visuals[index];
2017-01-09 13:25:52 +03:00
}
}
}