For example the twitter application you can open one profile and see his tweets then open another profile and go and repeat the same action over and over again, then you can tap on the back button as many times you opened tweets and profiles etc, returning from the same path.
a code example would help me a lot :)
You are looking for examples of a UINavigationController. This allows you to push new UIViewControllers into the navigation hierarchy and helps manage popping the view controllers off when you hit the back button (you can do this programatically also).
There are a bunch of articles on MonoTouch.Info about UINavigationControllers. I think that would be the best starting point for you.
Related
I've created a simple dialog here with a list of people. All I want to do is a few simple things which are rather trivial in winforms. However I'm struggling to grasp how to do this in wpf with an mvvm approach. Could someone help me out please.
When the user hits the Add New Person button, I want a dialog to appear where a user can type in their Name and either hit OK or Cancel. If the user hits OK, it appends the person to the list. (keep in mind i'll add more edting fields for the users to input, for example last name...)
When the users has a single item in the list selected, i want them to give them the ability to click an 'edit' button showing a dialog similar to the one in the previous step, pre populated with the selected items data, so a user can edit the properties. Then depending on if they hit OK or Cancel the changes are committed.
Dropbox solution: https://www.dropbox.com/s/8sjpabfod08yil5/AddDeleteItems_basic.zip?dl=
To create and display dialogs using MVVM, you'll want to implement a dialog service pattern to handle such requests. This service would be called from within your view model.
There is a really informative Code Project article about this very topic (Showing Dialogs When Using The MVVM Pattern. My advice would be to read that article and then look through the source files accompanying the article. This should provide you with a very good starting point to achieve your use cases (custom dialogs) and can also be used for displaying standard dialogs too (e.g. open file, save file, browse folder etc).
The service pattern isn't the only way to implement this, in the following article I show how to do it using the same data-driven mechanism used for regular windows:
http://www.codeproject.com/Articles/820324/Implementing-Dialog-Boxes-in-MVVM
I suggest this tutorial for you to get started. However, for the dialog Xceed library has some cool custom controls that may help you.
I have an app where you could go through in views like;
play -> normal or custom -> select map -> summary -> start
I would like to make a shortcut option from play to summary, but I also want navigation back to select map page with the back button functionality.
So the normal workflow p->noc->sm->summary but I want to implement p->sm with the noc<-sm<-summary back functionality too (with the windows phone back button).
I saw how can I delete items from the backstack, but google not helped me how can I navigate through a couple of windows without showing that to the user.
Am I need to override the back button or there is a "better" way to do that?
It's a WP8 project.
Edit:
I didnt need the exact codesnippet for this just a design concept in this patform. (just for the is it duplicated guy)
My normal or custom and select map page should be randomized when I do the shortcut, both of these pages has a "button" which can randomize those settings, I just want a swipe->press->swipe->press->swipe actions shortened to a button press without loosing the 'post modification after randomized' feature.
After I read your comments I think I will handle the back button all of the mentioned views so the backstack will not be getting inconsistent at any state. If I understand well I can tell it in every page what is the "backed" page.
You can't inject pages into the backstack. You can override the back button and do a forward navigation with the animations you would normally do when going backward (and then remove the page you just came from off the stack), but honestly, this all gets complicated and for good reason. One of the few hard truths of Windows Phone design is that you shouldn't mess with the backstack.
Instead, I would rethink your flow. It seems like your second page is a setting of some sort (Normal or Custom). If that is changeable, maybe make a button that can float a modal popup on top of the page and move things around according to the new decision.
Looking again at your flow, it seems like several of the pages may be settings. Can you combine those into one page, maybe on a pivot or panorama? That way making changes is just a swipe away.
Regardless, while it is possible to do what you are looking to achieve, I would look long and hard at whether it is actually the best experience for your users.
I'm developing an app in Visual studio using Xamarin and MVVM light. My app will have a settings page (view) with several main categories and when the user clicks one of them I want a new view to appear with detailed settings for that specific category.
My question is rather simple, but after spending 2 hours on google I've finally given up. Is it possible to combine these detailed settings in one file/view, instead of having one view for each and everyone, since this will give 6+ views just for settings.
I've read something about using listboxes, contentviews and observablecollection but I haven't really understood how everything works.
For example:
The settings screen will show a list of categories such as: Alert options, device options, configure status etc... Each of these categories have their own options such as: turn on/off sound, vibration, screen dimming. Different kinds of alerts and so on.. I'm wondering if I can achieve this without a view for each category.
Of course you can achieve it all in one view, it's all about how you want to design the user interface of your application.
It's all up for you to decide. Do you want to show all the detailed options at once, or have them show up once a category is clicked. Do you want it to work like an "accordion" type group where once you click one group, the others collapse, etc.
On mobile phones often the best practice is exactly what you described, clicking on a group of options loads a new screen with just those options. Users can use the back button to go back to the previous screen, they can see the detailed options without additional clutter, it's pretty common and nice and clean.
I am not sure why you think having 6+ views just for settings is somehow bad. You should structure your project into appropriate folders for easier organization.
Even if you wanted all the options to be on a single screen, I would still advise that you split them up into different files for easier maintenance and readability, then put them together inside one parent view as layout components of some type.
More files is usually a lot cleaner, better and more maintainable than one giant file with everything in it.
Of course, there is such a thing as too many files, so just use some common sense.
In your example, I see nothing wrong with having a folder inside your Views folder titled "Settings" then having separate appropriately named files for each of the sections.
If you have an idea of how else you would like to present this information, please elaborate on it so we can offer suggestions.
I developed a quite popular news app for a newspaper. Unfortunately, my users reported the following problem that I can reproduce:
The App basically consists of a GroupedItemsPage and a ItemDetailPage (and several other pages, not important here). The GroupedItemsPage shows the news grouped by category. As the user scrolls to the right, he clicks on one of the items of interests, gets redirected to the ItemDetailPage and navigates back. Back on the GroupedItemsPage the view jumps back to the first group and does not stay at the last position (group) the user has been. The exact same behaviour can be found (in my environment) when I create a new Windows Store "Grid App".
Unfortunately, I was not able to resolve this problem on my own, nor have I found some useful comments in the web. I saw several other apps who could solve this issue and others didn't. Any comment would be very much appreciated. Thank you!
You need to implement this by your self. When navigating from GroupedItemsPage to ItemDetailPage you need to remember the click item. Then, when you navigate back to GroupedItemsPage you need to scroll to the remembered item. You can do it by using the ScrollIntoView method on your GridView.
I found another, easier solution. I'd like to share it:
In the GroupedItemsPage (XAML) i added:
<common:LayoutAwarePage
NavigationCacheMode="Enabled" ...
I am trying to design a multiple page web form to collect information from the users. Users can quit at any time and then come back later on the page where they left, I send an email to users containing a link back to their application when they start application process. I am wondering if I can do this with asp:wizard? Does anyone know whether I can use asp:wizard to start from a page where user has left along lets assume 3rd page with their filled data and also when they click back, they should be taken to the prev. page i.e. 2nd page.
I think this is not a good approach. There must be some alternative, that you must try. Nut If this is your requirement, then you might face issues like this
You need to maintain a database of the anonymous users or the users that are using the wizard. Result waste of database sapce.
How would you define that the returning user is the same genuine user , not some bot or hacker. As this might leads make data public. For example you are Akshay , you filled up to wiz#2 and quit. Now next day you want to complete the form. How the system will know u r Akshay Kumar not Sunil Shetty. Also if some Jhonny Lever come and might take a hit and trial on Akshay , then he will get you.
So take a deep thought on the issue and discuss with the seniors regarding the alternatives, also there are lots of SO Guru, which will definitely suggest you some good way out.
I am not using Wizard anymore, but it is possible to go back to any step of the form wizard by using Wizard.MoveTo method. see here