MenuFlyout.ShowAt(UIElement, Point) 方法

定義

顯示與指定之目標專案相關的指定位移所放置飛出視窗。

public:
 virtual void ShowAt(UIElement ^ targetElement, Point point) = ShowAt;
void ShowAt(UIElement const& targetElement, Point const& point);
public void ShowAt(UIElement targetElement, Point point);
function showAt(targetElement, point)
Public Sub ShowAt (targetElement As UIElement, point As Point)

參數

targetElement
UIElement

要作為飛出視窗放置目標的 元素。

point
Point

要從指定的目標專案位移飛出視窗的點。

範例

若要將功能表置於相對於 UI 元素的位置,請指定元素和位移。

MenuFlyout.ShowAt(element, new Point(0,0));

若要將功能表相對於應用程式視窗的位置,請將 targetElement 參數設定為 null

MenuFlyout.ShowAt(null, new Point(x, y));

備註

當您呼叫這個方法以顯示 MenuFlyout 時,它會視需要自動在應用程式視窗外部轉譯。

某些屬性可能不會如預期般流動,例如 FlowDirection。 若要確保正確的流程,您可以在 MenuFlyoutPresenter 中設定流程方向:必須先設定 MenuFlyoutPresenter,才能第一次顯示 MenuFlyout。

適用於

另請參閱