Making first windows store app and need to have some controls show up at the top and bottom of every screen. When I did some WPF dev, I created a usercontrol and added it to every page. How is this done in windows store apps?
More specifically the header has a company logo and a status icon that changes based on an external resource (idle -> running, etc). The footer is where navigation happens in a somewhat linear fashion. Also, the footer displays the date and current time that continues to update. with the content in the middle changing based on what is selected in the footer.
There are a couple of different ways to do this. It really matters on whether you need it to be the same control (same instance) or if it is just a header/footer control which is added to each page and changes based on what you put into it.
Firstly, if this is something that can be incorporated into a CommandBar, that's the first thing I suggest you try. Then you can just create a StaticResource for each CommandBar, styled in the way you want for the header and footer. When you declare each page, in the root declaration, just set:
Page.TopAppBar="{StaticResource MyHeader}"
Page.BottomAppBar="{StaticResource MyFooter}"
You can make them Sticky and style them in any way that you would prefer, including having a collapsed version with just an ellipsis (...) to hide/show it. You can store all of the data for them inside of their own ViewModels, and have the control's DataContext just bind directly to the VM so that each instantiation pulls from the same data.
If it's not something that can be incorporated into a type of CommandBar, then I suggest you create your own Page subclass. The Template for it will wrap its ContentPresenter in your custom Header and Footer objects, likely in a Grid panel. This way will create a new copy of them each time, so they'll still need to bind to a ViewModel.
The final option that I see is to create a parent Page which has, similar to the subclass method, your header and footer wrapping the content. This time though, have them wrap a Frame. Then, all you have to do is call Frame.Navigate on that Frameand the header/footer controls will not be recreated, only the content in between them.
You can see something similar to this done in most of the Windows 8/8.1 app samples. They create a Content Frame, then navigate that through each page of the sample, generally on a selection from a navigation ListBox.
If you add a bit more information, I can try and tailor the answer a bit and provide some more specificity, but these are the general ways that I can see for you to accomplish what you have described.
Update:
Based on what you've said, to me it seems like the easiest thing to do would be to go with the third option, a Page wrapping a Frame. I suggest this because then it makes it quite easy for the bottom bar to affect navigation, and it sounds like you don't want the header or footer to be affected by page transitions.
If you check out the official ListView sample, you'll note their main page is declared something like this:
<Page
...>
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<!-- Navigation and other stuff -->
<Frame Grid.Column="1" x:Name="ScenarioFrame" Margin="30,50,30,0" />
</Grid>
</Page>
This is your basic main page declaration. You can then declare three Rows, one for your header, one for your Content, and one for your footer. If you want the footer to pop in and out, you can totally build the footer you have described into a CommandBar and include it on this page. Whenever you need to Navigate, just call ScenarioFrame.Navigate from your code-behind. You can now create Pages like normal, and Navigate to them like you would any other app.
This should also be 'Universal', so you should be able to include it in a Universal app, so long as you make sure your footer scales to the size of the screen (which you should already do). If you do try this, make sure that your navigation code in your main page is as generic as possible and the majority of the 'specialty navigation', such as Panes and settings are handled each platform-specific page, or at least via messaging (such as that provided by MvvmLight) and a NavigationHelper class.
Hope this helps and happy coding!
And in what conditions should you use one over the other?
The HTML controls intent is to merely show an existing HTML page in place with the goal of merely presenting it. With page control, you can extend it with behaviors, compose it with more page controls and have it work with your navigation model.
I'd like to know, how I can implement my own SemanticZoom WITHOUT GridView control.
I have my own custom controls on the mainpage but a structure similar to a grouped GridView and I want to open details after the user makes a zoom-gesture on a group.
But it seems that the SemanticZoom control only works together with the GridView.
Any ideas?
cheers, Thomas
The controls contained inside the SemanticZoom control can be any control that implements the ISemanticZoomInformation interface - ISemanticZoomInformation interface
Simple example at Semantic Zoom only supports GridView and ListView?
What is the difference between <common:LayoutAwarePage and <UserControl... in XAML in Windows 8. Looks like both are used as W8 pages.
A Page is what you need to use inside of a Frame to support the standard navigation framework and the standard AppBar class. LayoutAwarePage adds support for different visual states depending on layout (portrait, landscape full/filled/snapped), which really is required when you are building an app to submit to the store.
A UserControl is just a simple way to group some UI pieces and code-behind together useful especially if you want to have a reusable piece of UI that shows up on different pages or if your page design becomes too complicated (eg. if you have a lot of XAML for different page layouts). It is also useful if you want to create a common control to be reused in multiple places or multiple projects, but don't care about being able to restyle it - then you would need to create a custom/templated control.
layoutawarepage are page that allow supports for the various view such as filled, snapped, portrait and landscape. in which you would have to handle the visualstatemanager in xaml and do the switching from various view in codebehind.
while usercontrol are elements that you can place in other pages.
Is there a control in vb.net that is specifically designed for displaying content larger than the control itself?
I know it's possible to code your own using a panel and two scrollbars, but is there an already existing method for this?
Thanks for your help
All control containers, such as Panel, FlowLayoutPanel etc. have AutoScroll property, which does what you want.