WPF 标注锚点起始位置

use*_*877 1 wpf callout

我已经实现了 Blend 的 Callout 控件。我面临的问题是标注的锚点从顶部开始有一些边距,而我想从标注的左上角开始锚点。任何帮助将不胜感激。

我现在拥有的:

在此输入图像描述 我想要什么:

在此输入图像描述

She*_*dan 5

您似乎错误地使用了此控件。从 MSDN 来看,该Callout.AnchorPoint属性 获取或设置标注相对于左上角和左上角的位置。它用于定位控件并且不会改变的形状Callout


更新>>>

老兄!!!这是一个非常简单的形状...只需用...绘制自己的形状Path...然后您可以将其做成任何您想要的形状:

在此输入图像描述

<Path Stroke="Black" StrokeThickness="1" Fill="#CCCCFF">
    <Path.Data>
        <CombinedGeometry GeometryCombineMode="Union">
            <CombinedGeometry.Geometry1>
                <RectangleGeometry RadiusX="20" RadiusY="20" Rect="0,0,300,200">
                    <RectangleGeometry.Transform>
                        <TranslateTransform X="30" />
                    </RectangleGeometry.Transform>
                </RectangleGeometry>
            </CombinedGeometry.Geometry1>
            <CombinedGeometry.Geometry2>
                <PathGeometry>
                    <PathFigure StartPoint="0,30">
                        <LineSegment Point="50,10" />
                        <LineSegment Point="50,50" />
                    </PathFigure>
                </PathGeometry>
            </CombinedGeometry.Geometry2>
        </CombinedGeometry>
    </Path.Data>
    <Path.Effect>
        <DropShadowEffect Color="Black" Opacity="0.4" Direction="-135"
            ShadowDepth="10" />
    </Path.Effect>
</Path>
Run Code Online (Sandbox Code Playgroud)