Margin on all content pages in Template10 XAML

73 views Asked by At

I am using Template10 with the Hamburger starting project template. I'd like to have a margin between the hamburger area on the left and all content. I tried changing the shared Shell.xaml page (by adding a margin, etc.) but couldn't figure out the best way to sort it out. Conceptually, that makes sense, but it's the specific detail of how to make it work that I'm missing.

Is there an easy way to do it without changing each content page?

Regarding the questions in the comments: I want it in the closed case of a wide view; the question doesn't make any sense in any other case.  As far as what I tried, it doesn't really ultimately matter, since none of what I tried worked - I'm asking what the right way is to do it, which I never figured out.

Here's what the default looks like, without a margin:

view with no margin Here's what it looks like with a margin added to the content area, which is also how the sample template contents handle this:

view with margin

I don't want to have to mark up every content page with left margins to get the offset in the second picture.

  1: https://i.stack.imgur.com/jUIuO.png

1

There are 1 answers

1
Jerry Nixon On BEST ANSWER

Okay, now I have enough information. You have a few options here. The first is just bite the bullet like the rest of the developer community and format your pages like normal. But if you simply must, you can create an implicit Page style with a setter setting Margin="16,16,16,16" but, listen, and I am not kidding, you will ultimately regret it unless your app is super-simple. The biggest problem will be the spacing will be OUTSIDE the containing ScrollViewer.

Thanks for using Template 10.