For easy of development I’m using a ViewBox to wrap all content inside a Window. This is because my development machine has a smaller screen than the deployment machine so using a ViewBox allows for better realisation of proportion. Obviously there is no reason for it to be there on Release versions of the code. Is there an easy method to conditionally include/exclude that ‘wrapping’ ViewBox in XAML?
E.g.
<Window>
<Viewbox>
<UserControl /*Content*/>
</Viewbox>
</Window>
create two control templates in a resources dictionary somewhere accesible.
they should look like this
then you could use this in your main view
then to switch back and forth just change the lookup key in the
StaticResourceBinding from ‘debug_view’ to ‘release_view’if you wanted to make it more dynamic you could additionally do this:
then in your codebehind
this way depending on whether or not the DEBUG symbol is defined different templates will be selected.