I have two different styles for my window:
- Regular – window has title bar and can be moved/resized
- Fixed – window has no title bar and is fixed at the center of the screen
The window is too wide for either of the monitors on my development machine, but it’s a perfect fit for the target/install machine. So, when debugging, I need to be able to move the Window so I can see everything on it, but when I release the app, I need it to run in “full screen” mode (like a PowerPoint app in projector mode).
Is there any way to set the Style property of the window based on whether I’m compiling in Debug vs. Release mode? I was thinking I might be able to use a binding, but I’m not quite sure how to implement it.
Create a Style picker class:
in your App.xaml
add to your Application.Resources your debug and release style + a instance of the StylePicker and set the ReleaseStyle and DebugStyle to the previous set up styles:
In your Window markup set up the WindowStyle like this:
You can reuse the DebugReleaseStylePicker to set the style to any other control not just the Window.