Resize and move standard mdi window

Docking/MDI for WPF Forum

Posted 6 years ago by Francois Bergeron - President, Synergistic Manufacturing Solutions Inc.
Version: 13.2.0590
Environment: Windows 8 (64-bit)
Avatar

Hi,

I'm trying to resize and position a DocumentWindow with previously saved configurations and I'm having a problem.

Here's my code :

dw.StandardMdiLeft = double.Parse(graphic.getProperty("WindowLeft"));
dw.StandardMdiTop = double.Parse(graphic.getProperty("WindowTop"));
dw.StandardMdiWidth = double.Parse(graphic.getProperty("WindowWidth"));
dw.StandardMdiHeight = double.Parse(graphic.getProperty("WindowHeight"));

where dw is a DocumentWindow contained in a DocumentWindowCollection hosted in my docksite.

The code doesn't bug but nothing happend. I've try and look for a "Refresh" command to apply the modified settings but can't find anything.

Comments (4)

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Julien,

I just did a test in our main demo where I added this code in response to a menu item click:

dockSite.Documents[0].StandardMdiLeft += 100

When the document was in standard MDI mode, I did see it move to the right.  Do you see the same thing?


Actipro Software Support

Posted 6 years ago by Francois Bergeron - President, Synergistic Manufacturing Solutions Inc.
Avatar

Sadly no, I just simplified my code in order to test it.

My interface offer the choice of tabs or windows, this is the code that's is being run when the user choose windows
--------------------------------------------------------------------------------------------------------------

this.workspace.SwitchToStandardMdi();

this.workspace.DockSite.Documents[0].StandardMdiTop = 100;

--------------------------------------------------------------------------------------------------------------

With a breakpoint right after the 2nd line, I can see that the value of StandardMdiTop is indeed 100 but nothing happend to the window. Also, the value doesn't "stick", what I mean by that is if I fire another breakpoint and look at the value for StandardMdiTop, the value is 2, the default value.

Here's my xaml

---------------------------------------------------------------------------------------------------------------

<docking:DockSite Name="DockSiteGraphs" CanDocumentWindowsClose="False" Margin="0,40,0,0">
  <docking:Workspace Name="WorkspaceGraphs">
    <docking:TabbedMdiHost CanDocumentsDrag="False" IsCloseButtonOnTab="False">
      <docking:TabbedMdiContainer />
    </docking:TabbedMdiHost>
  </docking:Workspace>
</docking:DockSite>

---------------------------------------------------------------------------------------------------------------

Here's how I add the DocumentWindow to the docksite

---------------------------------------------------------------------------------------------------------------

DocumentWindow window = new DocumentWindow(docksite, "Graph" + graph.Id.ToString(), graph.Description,null, (new GraphViewer(menuDisplay, new Graph(graph))));
window.Activate();

---------------------------------------------------------------------------------------------------------------

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Julien,

Since you said the value changes later, I wonder if perhaps upon the load of the standard MDI, it's doing an auto-cascade.  Perhaps if you did a Dispatcher.BeginInvoke for the line where you set the top and move it to be after Loaded priority, it would fix it?

If that doesn't help and you are stuck, please make a new simple sample project showing the issue and email that to our support address, referencing this thread.  Be sure to rename the .zip file extension so it doesn't get spam blocked.  Then we'll take a look to see what happens.  Thanks!


Actipro Software Support

Posted 6 years ago by Francois Bergeron - President, Synergistic Manufacturing Solutions Inc.
Avatar

Invoke did it! Thanks a bunch

The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.