I created a WPF Popup Control on my WPF Form. When I click, the Popup Opens and it also moves properly. but when I Clicked on textbox in popup window then popup moves slightly towards the edge of main window. I don't want to move popup when I clicked on textbox in Popup?
Here is my code:
- private void MyAddJobPopup_MouseMove(object sender,System.Windows.Input.MouseEventArgs e)
- {
- if (!MyAddJobPopup.IsOpen)
- MyAddJobPopup.IsOpen = true;
- if (e.LeftButton == MouseButtonState.Pressed)
- { var mousePosition = e.GetPosition(this.HardwareElectricalTbl);
- this.MyAddJobPopup.HorizontalOffset = mousePosition.X;
- this.MyAddJobPopup.VerticalOffset = mousePosition.Y;
- }
- }