public static class AttachedProperties
{
public static readonly DependencyPropertyKey MidPointProperty =
DependencyProperty.RegisterAttachedReadOnly("MidPoint", typeof(Point), typeof(FrameworkElement), new PropertyMetadata(default(Point)));
public static Point GetMidPoint(FrameworkElement element)
{
return new Point(element.ActualWidth / 2, element.ActualHeight / 2);
}
}