Ticket T666010
Visible to All Users

I have a question about the WindowedDocumentUIService

created 7 years ago (modified 7 years ago)

Hi.
I have a question about the WindowedDocumentUIService.
I am using the code below to pop up the pop-up window.
I always want to show a pop-up window in the center of my parents' window.
But it does not appear in the center of the parent window.
The pop-up window is always located in the center of the main window.
How can I implement the functionality I want?
-----------------------------------------Code----------------------------------------------

XAML
<MainWindow.xaml> <dxmvvm:Interaction.Behaviors> <dx:WindowedDocumentUIService x:Name="DocumentPopupService" WindowStartupLocation="CenterOwner" DocumentShowMode="Dialog" /> <dx:WindowedDocumentUIService x:Name="DocumentModalessPopupService" WindowStartupLocation="CenterOwner" DocumentShowMode="Default"/> </dxmvvm:Interaction.Behaviors> <MainWindowViewModel>
C#
void IMain.OpenDocumentPopup(...... object parent) { IDocument doc = DocumentModalessPopupService.FindDocumentByIdOrCreate(id, sv => { IDocument document = sv.CreateDocument(viewName, parameter, parent); <<<<<<<<< parent document.DestroyOnClose = true; document.Title = title; return document; }); doc.Show(); DocumentModalessPopupService.ActiveDocument = doc; }

<Sub1ViewModel>
  object parent = this;
  Main.OpenDocumentPopup(… parent);  <<<<<<<<< parent

Answers approved by DevExpress Support

created 7 years ago (modified 7 years ago)

Hi,
WindowedDocumentUIService uses a window where the service is defined as an owner. I suggest that you redefine WindowedDocumentUIService at the child window level. In this case, this child window will become WindowedDocumentUIService's owner. I have attached a sample project to demonstrate this approach. Please take a moment to review it and let us know if you need further assistance.

Thanks,
Alexander

    Comments (3)

      Thank you for your solution

        I have additional questions.
        Most pop-ups work exactly the way you tell them.
        However, some pop-ups bound to ItemSource in some DockLayoutManager still appear in the center of the main window.
        Are windows that are dependent on the DockLayoutManager unable to do what I want?

        DevExpress Support Team 7 years ago

          Hello,

          I've created a separate ticket on your behalf (Defined in a layout panel WindowedDocumentUIService uses as owner a window where DockLayoutManager is placed). It has been placed in our processing queue and will be answered shortly.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.