How can I disable minimize/maximize buttons ONLY for floating windows

Docking/MDI for WPF Forum

Posted 8 years ago by SebUbi
Version: 16.1.0633
Avatar

Hi,

I would like to know if it's possible to disable (and hide) minimize/maximize buttons ONLY for floating windows.

 

Thx

Seb

[Modified 8 years ago]

Comments (14)

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

Hi Seb,

Which kinds of floating windows are you referring to.  Such as when a standalone tool window is floated or when a document is floated?


Actipro Software Support

Posted 8 years ago by SebUbi
Avatar

Hi,

I think I need to handle that when I undock document (in the center) and window undocked from a TabPanel. 

Basically it s not window generated over main window (in this case I know HasMinimize and HasMaximize exist to disable buttons).

 

Seb

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

Hi Seb,

If you only wanted this for floating tool windows, there are DockSite.FloatingToolWindowContainersHaveMaximizeButtons and FloatingToolWindowContainersHaveMinimizeButtons properties that you could set to false to control that.

For floating document windows, it's a bit trickier.  You'd have to make a class that inherits DockSite and overrides its InitializeFloatingWindow method like this:

protected override void InitializeFloatingWindow(Window window) {
	var chrome = WindowChrome.GetChrome(window);
	chrome.HasMaximizeButton = false;
	chrome.HasMinimizeButton = false;
}

You could update other properties of the Window or the WindowChrome there as appropriate too.  Note that the above method is called for both tool and document windows that get floated.


Actipro Software Support

Posted 8 years ago by SebUbi
Avatar

Hi,

So it works for floating tool windows but not for Document Window in the center. I can t find this function in DockSite class

public class MyDockSite : DockSite
{
    protected override void InitializeFloatingWindow(Window window)
    {
        var chrome = WindowChrome.GetChrome(window);
        chrome.HasMaximizeButton = false;
        chrome.HasMinimizeButton = false;
     }
}

Not found method !

[Modified 8 years ago]

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

Which version are you using?  It might have been added in the latest 2016.1 maintenance release.


Actipro Software Support

Posted 8 years ago by SebUbi
Avatar

v 15.1.0620

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

Ahh, sorry your original post said it was for the 2016.1 version.  In 2016.1, we rewrote the Docking/MDI product and there were some API differences.

In 2015.1, for floating document windows, you'd have to clone and alter the default template for the RaftingWindow class to set the HasMaximizeButton property to false on the WindowControl inside of it.  Since your company has WPF Studio, you can have whoever is listed on the account download the default styles/templates from our site.  Then make an implicit Style for RaftingWindow with an updated Template and put that in the Application.Resources.


Actipro Software Support

Posted 8 years ago by SebUbi
Avatar

Oh My bad sorry for the version number, was a mistake.

Ok let me try this.

 

Thx

Seb

Posted 8 years ago by SebUbi
Avatar

Please where can I found styles/templates on your website ?

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

Whoever is listed on the company account has access to download them.  It would be whoever is able to get the license information.  There's a link right next to that to get the default styles/templates.


Actipro Software Support

Posted 8 years ago by SebUbi
Avatar

I can t find style online so I tried to edit raftingWindow style with Blend but it tells me there is no RaftingWindow in WPF (I also added reference to Actipro dll).

What does it mean please ?

 

edit: I don't know why, I don t have ActiproSoftware.Docking dll in my project. It s maybe the reason why Blend doesn t find it.

edit 2: I added 2016 Docking Dll and no RaftingWindow found neither

[Modified 8 years ago]

Posted 8 years ago by SebUbi
Avatar

And I looked for it in Actipro WPF Studio Doc, I found a lot of infos about RaftingWindow but no style

Posted 8 years ago by SebUbi
Avatar

OOhh I checked path in my project and I have 2016 Actipro release, so first solution should work.

v. 2016 .1.0630 to be exact

[Modified 8 years ago]

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

Hello,

Blend doesn't always copy third party control styles/templates correctly.  You need to get whoever has access to your company's Actipro account (whoever gave you the license information) to log in and download the default styles/templates for you since you aren't associated with your company's account right now.

If you are converting to 2016.1 instead, please note there are some breaking changes over 2015.1.  You'll need to look at the "Converting to 2016.1" topic in the documentation for all the details.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.