mirror of
https://github.com/VitalickS/BrightSharp.Toolkit.git
synced 2026-03-21 10:21:16 +00:00
.net copy
This commit is contained in:
48
BrightSharp.NET/Diagrams/Adorners/ResizeRotateAdorner.cs
Normal file
48
BrightSharp.NET/Diagrams/Adorners/ResizeRotateAdorner.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace BrightSharp.Diagrams
|
||||
{
|
||||
[ToolboxItem(false)]
|
||||
public class ResizeRotateAdorner : Adorner
|
||||
{
|
||||
private VisualCollection visuals;
|
||||
private ResizeRotateChrome chrome;
|
||||
|
||||
protected override int VisualChildrenCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return visuals.Count;
|
||||
}
|
||||
}
|
||||
|
||||
public ResizeRotateAdorner(ContentControl designerItem)
|
||||
: base(designerItem)
|
||||
{
|
||||
SnapsToDevicePixels = true;
|
||||
chrome = new ResizeRotateChrome();
|
||||
chrome.DataContext = designerItem;
|
||||
visuals = new VisualCollection(this);
|
||||
visuals.Add(chrome);
|
||||
Focusable = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected override Size ArrangeOverride(Size arrangeBounds)
|
||||
{
|
||||
chrome.Arrange(new Rect(arrangeBounds));
|
||||
return arrangeBounds;
|
||||
}
|
||||
|
||||
protected override Visual GetVisualChild(int index)
|
||||
{
|
||||
return visuals[index];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user