Click here to Skip to main content
16,023,224 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to disable the maximize button in WPF application page, not in a WPF application window

When I searched in Google, it is available methods for disabling the maximize button in WPF window

The code snippet is as follows

Window.WindowStyle= WindowStyle.None


But is not working in WPF page

It is showing errors.

In WPF page there is WindowStyleProperty instead of WindowStyle
and it is showing errors as


Error 1:A static readonly field cannot be assigned to (except in a static constructor or a variable initializer)



Error 2: Cannot implicitly convert type 'System.Windows.WindowStyle' to 'System.Windows.DependencyProperty'



So how can I disable the maximize button in WPF page


Then how can I implement it

Suggest me any sample code snippet....

Advance thanks.........
Posted
Updated 24-Mar-10 21:17pm
v2

Add resizeMode ="canMinimize" in your XAML.
 
Share this answer
 
Comments
[no name] 5-Jul-12 2:41am    
My 5
You can set the window style to not have a border, which is what you're trying to do, but you're doing it wrong. You need to use this, not Window, because otherwise you're trying to access the wrong thing. Then you'll have no buttons at all, and will need to add the ones you want. We had to do this for our app, also.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900