Am trying to design my metro app like, In my homepage I need to display list of items in a menu on the left side of page and when we click on each item,every item will need to navigate separate page and contains some data.Can anyone suggest me which control should you I take to start my scenario?Working examples are really helpful to me.
Thank you.
Navigation in a WinRT App doesn't use the Menu/Menu-Item metaphor. You can add an App Bar that swipes up from the bottom of the screen that you place contextual controls such as buttons related to the current page or selected item(s). You can also add global settings to the Settings charm that swipes in from the right.
What you are describing sounds like the "Split App" template that comes out of the box with Visual Studio 2012. It consists of a list of items along the left-hand side of the screen which, when selected, change the content on the right-hand side of the screen. Try creating a new Split App and see if that helps.
This is not a completed worked example, but I would recommend looking at two items:
MSDN Documentation for WinJS.Navigation
MSDN Sample for navigation application
These should get you the solution you need -- the sample is quite complete, and can be tailored to your needs.
It sounds to me like what you are talking about is the SplitApp view. Check out this link, the second template listed, just below GridView:
http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh768232.aspx
You'll find that in Modern/Metro things like menus are handled through contextual listviews in the window content area, or through charms (read icons) on the AppBar. Many people hear menu now and cringe, just due to the style guidelines for Chrome/Menu free applications.
If you don't want the content to display next to the links, as the SplitApp view does, you should consider a regular listview for your links, styled however you like and set to display vertically, with click events that take you to whatever detailed page view you want to go to. Navigation is dead simple in a Metro App.
C# Example:
this.Frame.Navigate(typeof(MyDetailPage),myContentId);
Then on your details page, you can get the argument when it's navigated to:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
var myContentId = e.Parameter;
...
}
And if absolutely none of the above was helpful, try checking out these examples. I know you probably aren't making an RSS reader, but they will take you through the basics of the various views and navigation.
Create a blog reader with C#/VB & XAML:
http://msdn.microsoft.com/en-us/library/windows/apps/br211380.aspx
Create a blog reader with JS & Html5:
http://msdn.microsoft.com/en-us/library/windows/apps/hh974582.aspx
Related
This question is about accessibility issue I have on one of my websites, when I use the tab key I get a few errors:
Only some parts of the navigation bar are selected
I cannot see which part is currently selected
Tabs are only going over navigation bar and not continuing to content
How can I address these issues? any good tutorials on this?
Thanks.
Here is a complete list for you to search for the problematic area:
Techniques and Failures for Web Content Accessibility Guidelines (WCAG) 2.0 from W3C
Some pages provide code/resources:
C15: Using CSS to change the presentation of a user interface component when it receives focus
G1: Adding a link at the top of each page that goes directly to the main content area (Skip to content)
I'm migrated from iOS dev to WIndows Phone dev and I have stumbled upon a problem.
I need to implement a side menu, that looks like the one in facebook app in ios. It shpuld slide from left to right. It should contain about 10 buttons (ListView). Presign the button should cause chaning the view (navigate to other xaml file)
Because of the huge difference between Windows Phone controls and iOS controls I want to ask an advice on how to better implement such menu. I've heard about aproach using Panorama. But would it look pretty?
I mean I'll have 10 different XAML files with different content. In each of them I'd have to add Panorama control and add the menu. And when I navigate to other XAML would it look nice? because it would close menu without any animation.
So please tell me what is the better approach in impelementing what I want? And how to navigate properly between all the XAMLs without loosing the animation of the menu. And of course how to avoid duplicating code in all the XAMLs? I guess XAML files could not be inherited. And of course I need it to support both WIndows Phone 8 and 8.1.
Thank you very much for you attension!
Here this a blog that will help you implement side menu like Facebook app. Link Hope this helps.
I just implemented something similar in my Dictionary app (http://www.windowsphone.com/s?appId=9f31b733-8c7b-e011-986b-78e7d1fa76f8). You will see that when you click the favorite or history icons on the top, it slides in a panel from the right. I implemented this by adding another Grid to the page whose left margin is set to the width of the page so that it basically sits to the right of the page, out of user's view. When the user taps one of the icons on top, I run a DoubleAnimation with a StoryBoard which does TranslateTransform on the X coordinate of the Grid and runs the StoryBoard for a duration of 3.5 seconds to give the user the perception of slide-in animation.
As far as having the same slide-in menu on each of the pages go, you have 2 options:
(a) Create the sliding panel as a user control and add it to each of the pages and on click of an item inside the panel, go to the second xaml page with the slide-in menu open and start the transition to hide it, or
(b) Create multiple grids within the same xaml page and simply hide/display the right one at the right time.
I believe you are speaking about the popular hamburger menu.
You can very well use the SlideView library. Here is the link,
https://slideview.codeplex.com/
The SlideView, a control allowing to slide between panels (2 or many more)
The SlideApplicationFrame, a control to use at top app level and packaged to display 3 panels with navigation occuring in the middle panel
The AutoHideBar, a control which is displayed when scrolling up in a list, and hidden when scrolling down
I need some help on a Windows Phone 8 app I am currently working on.
On the left side, I want a menu, if I click an item, I need to land on the corresponding page.
When the app opens, I see this menu and a bit of the next page.
I can switch between the menu and the full page with a button in the corner.
So far, so good.. I was able to build this and code a news page on the right to test this.
But then.. if I need to load another page, I'm in trouble, because my design at this moment
is a single XAML page that scrolls.
My question is this: Is there a way to load a XAML page in another XAML page?
Will this work with bindings?
Another option would be to put all the XAML for all menu items in place and only show
the things I need for a certain menu item (that feels quite wrong).
Or am I totally missing something?
All help would be very much appreciated, as I'm a new to developing for Windows Phone.
I added a simple drawing, which I hope can explain what I'm trying to.
You can add controls in c#.
namespace MyNamespace
{
public partial class SomePage: PhoneApplicationPage
{
public SomePage()
{
InitializeComponent();
LayoutRoot.Children.Add(new TextBlock()
{
Name = "MyTextBlock",
Text = App.ViewModel.Item[0].SomeProperty
});
}
}
}
I am porting a Desktop WPF application to WinRT and I'm facing a little issue.
I had a ItemsControl and I had a context menu on every item to delete / edit the item.
I have been told that PopupMenu are not good in WinRT and I should use a AppBar.
I think I'm doing something wrong or I misunderstood that.
I thought that I could put that options on a AppBar and when I select an element, popup the bar and click where I need.
The problem is that the AppBar will show up when I right click on any part of my app, so that buttons will show up with an item selected.
So can I change the layout of the AppBar on different contexts (because it seems that Microsoft wants us to use AppBar as context menu without context capabilities) or only show it when I want via code?
Would be good to have a TopAppBar with some App-wide options and a BottomAppBar just for ListView's item context menu.
Or maybe I'm doing all this stuff wrong and I have to use another approach to put extra options on the Listview's items.
You are thinking about this correctly. AppBar is the place where you should put all your non-essential and selection based commands.
The guidelines here and here suggest that they should be arranged as follows:
Navigation commands should be in TopAppBar
Commands related to selection should on the left side of BottomAppBar
The rest of page specific commands should be on the right side of BottomAppBar
Contextual commands should only be shown when a relevant item to that command is selected. For that purpose you should set Visibility of these commands accordingly. Also AppBar should open automatically when an item with contextual commands in it is selected. You can do that programmatically by setting its IsOpen property. You should also set it to sticky mode by via IsSticky property.
If you're using MVVM you can bind your viewmodel properties to all Button and AppBar properties mentioned above.
There's a CustomAppBar control available in WinRT XAML Toolkit. I haven't used it myself yet but it has a couple of extra features that might prove useful in your case.
Basically, what I want to do is put some buttons before the tabs in a gtk.Notebook. I tried making my own notebook type widget and it worked well, but it would have required lots more work to make it as flexible as I would like, also it wasn't as efficient.
Here is a mock-up of what I'm trying to achieve: http://imagebin.ca/view/84SC0d.html
Any ideas would be much appreciated, thanks.
Ben.
You might be interested to know that this functionality has been added in GTK 2.20, see "Changes in GtkNotebook" in the following announcement: http://mail.gnome.org/archives/gtk-devel-list/2010-March/msg00132.html
It's a hack, but you can put your widgets on a separate tab, and then prevent the tab from being clicked by registering the following switch-page event for the notebook:
def onTabsSwitchPage(self, notebook, page_notUsableInPython, pageNumber):
# Don't allow to switch to the dummy tab containing widgets
if pageNumber == <put correct tab number here>:
notebook.stop_emission("switch-page")
Note that this doesn't look good with all GTK themes, but it works...
I don't think there's any way to do it without making your own notebook widget. There are a couple of hacks. One was posted by AndiDog. Another is to hide the tabs altogether (notebook.set_show_tabs(False)) and make a toolbar with buttons above the widget, with your buttons on the left, plus one button for each tab in the notebook that switches to that page.
Instead of making your own notebook-type widget from scratch, you could inherit from gtk.Notebook, overriding some of the methods like expose_event, size_request, and size_allocate, in order to deal with two types of container children: pages and buttons. I don't know how to do this in PyGTK though, only in C.
You might also consider whether the buttons in the tab space are really what you want. What if the user resizes your notebook small enough that some of the tabs disappear? Where do the previous tab/next tab arrows go? What happens to the buttons?