ContextMenu.CustomPopupPlacementCallback 属性


获取或设置一个回调,该回调指示 ContextMenu 应放在屏幕上的什么位置。Gets or sets a callback that indicates where a ContextMenu should be placed on the screen.

 property System::Windows::Controls::Primitives::CustomPopupPlacementCallback ^ CustomPopupPlacementCallback { System::Windows::Controls::Primitives::CustomPopupPlacementCallback ^ get(); void set(System::Windows::Controls::Primitives::CustomPopupPlacementCallback ^ value); };
public System.Windows.Controls.Primitives.CustomPopupPlacementCallback CustomPopupPlacementCallback { get; set; }
member this.CustomPopupPlacementCallback : System.Windows.Controls.Primitives.CustomPopupPlacementCallback with get, set
Public Property CustomPopupPlacementCallback As CustomPopupPlacementCallback


一个指定 ContextMenu 的位置的回调。A callback that specifies the location of the ContextMenu.



Custom必须将Placement属性设置为才能使用回调委托。The Placement property must be set to Custom for the callback delegate to be used.

委托返回相对PlacementTarget于定义的可能点的数组。 CustomPopupPlacementCallbackThe CustomPopupPlacementCallback delegate returns an array of possible points that are defined with respect to the PlacementTarget. 显示上下文菜单时, 将选择一个点来最大程度地显示可见ToolTip窗口的数量。When the context menu is displayed, a point is chosen that maximizes the amount of the ToolTip window that is visible.

行为与弹出窗口的行为相同。The behavior is the same as it is for the popup. 有关详细信息,请参阅如何:指定自定义 popup 位置popup 放置示例For more information, see How to: Specify a Custom Popup Position and Popup Placement Sample.

依赖项属性信息Dependency Property Information

标识符字段Identifier field CustomPopupPlacementCallbackProperty
元数据属性设置为trueMetadata properties set to true NoneNone