Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4970
how to put XamDialogWIndow in the center of the browser window?
posted

with sample code from Infragistics, in order to add XamDialogWindow, need to do as:

1. add Canvas in parent control as popbase.

2. then add an instance of XamDialogWindow to Canvas's children collection.

In this way, XamDialogWindow will popup in the center of the parent control.

My question is: how to put the popup in the center of the hosting browser?

have try in different way:

1.if do nothing, popup will be at top-left of browser window.

2. try set following:

XamDialogWindow.StartupPosition = StartupPosition.Center;

XamDialogWindow.StartupPosition = StartupPosition.Center;

XamDialogWindow.CenterDialogWindow();

the popup will be always at the right of the center point.

vertical position looks like fine.

How to resolve this problem?

  • 35319
    posted

    Hello,

     

    I have been looking into your question and I can suggest you handle the ‘SizeChanged’ event of the UserControl and call the ‘CenterDialogWindow’ method of the XamDialogWindow like :

     

    private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)

            {

                this.XamDialogWindow1.CenterDialogWindow();

            }

     

    This way the XamDialogWindow control will be always positioned in the center of browser.

     

    If you need any further assistance on this matter, feel free to ask.