How to set the location of a WPF window?

前端 未结 4 2123
半阙折子戏
半阙折子戏 2020-12-06 04:31

I have a List View in which I have defined a custom cell as a user control.

In the custom cell I given user hyperlink, I am showing a WPF dialog when user clicks on

4条回答
  •  温柔的废话
    2020-12-06 04:52

    Window.Left and Window.Top

    var location = myTextBlock.PointToScreen(new Point(0, 0));
    window.Left  = location.X;
    window.Top   = location.Y - window.Height;
    

提交回复
热议问题