MvvmCross clear navigation stack for Xamarin forms app - xamarin.forms

I have trouble when I have to delete navigation stack until to determined page. I couldn’t find any feasible solution without NoHistory option. I can remove some pages which have been opened on main page with nohistory attribute but I need another things.
I can explain my problem better with an example. Imagine that I have 5 different pages and the navigation stack’s state is 1 > 2 > 3 > 4 > 5. Third page should be opened when particular button is pressed on page of 5. Actually the navigation stack’s new state should be 1 > 2 > 3.
How can I apply that operation, please could someone add suggestion for this?
Xamarin Forms version is 3.6.364807
MvvmCross version is 6.2.3.

I don't know which version of mvx you are using but if it's one of the last ones you can do:
this.navigationService.ChangePresentation(new MvxPopPresentationHint(typeof(MyThirdViewModel));
This will pop every viewmodel until the third one.
Here you have the hint in the repo
If you don't have that hint because of using a previous version of mvx you can refer to this question to have an idea of how to implement a custom hint.
HIH

Related

MasterDetail and NavigationPage deeplinking in Prism Forms

I am testing the deeplinking feature of the Prism Forms framework. I currently have a situation where I have a MasterDetailPage with a menu as Master. When I click the menu items, the Details should change to specific pages with a clean NavigationPage as container.
When I check the Sandbox example for Prism Forms, it shows an example for MasterDetail navigation, but not including navigation pages.
So I have this (absolute) deeplink structure at startup: /MasterDetailPage/NavigationPage/MyFirstPage
Then I want the second menu item to link to a fresh NavigationPage:
/MasterDetailPage/NavigationPage/MySecondPage
My current workaround is to do absolute deeplinking, but I was wondering if there is a better way? The Prism PageNavigationService checks to see if the segment type is the same as the current detail type. But since these are both NavigationPages, it tries to add the new page in the already existing NavigationPage. At that moment it also kills the menu-icon (at least on iOS).
Actually, the Sandbox app does use NavigationPages in the MasterDetail: https://github.com/PrismLibrary/Prism/blob/master/Sandbox/Xamarin/HelloWorld/HelloWorld/HelloWorld/Views/MyMasterDetail.xaml
Prism reuses the detail page for performance reasons, but it doesn't work like you think it does. While it does add the new page to the NavigationPage's NavigationStack, it also removes the previous page from the stack. This keeps the NavigationStack in the proper state.
The icon behavior you are seeing is because of a confirmed bug in Xamarin.Forms. You can follow the issue here: https://bugzilla.xamarin.com/show_bug.cgi?id=41038
As soon as Xamarin fixes this bug, I will publish the fix to Nuget. In the mean time, the only way to get around this is to fork the Prism code base and remove the Page type check.

Different behavior of Foundation 6 Top Bar Menu for two (nearly) similar pages

I created a draft for a website with Foundation 5 (F5) and Textpattern. But I decided to upgrade my documents to Foundation 6 (F6) some months after it was released. Unforunately, I'm not really happy with the new menu structure (so far...) and will try some other things out with Foundation's Building Blocks etc. But first, I need to find out the reason of a different behavior of the F6 Top Bar menu bar for two of my pages:
The Top Bar is looking OK on the home page: http://frickeln.jensfreyer.de/ But...
...the menu toggle + menu/submenu function does not at another place: http://frickeln.jensfreyer.de/blog/.
Do you have an idea why this happens? The html documents are reduced to the max. and a comparison of the source codes doesn't tell me why. But possibly you see it... and I overlooked sth. (I would be happy).
I'm using Foundation 6.1.2 and Textpattern 4.5.7.
On the blog page, foundation.min.js and jquery.min.js are not linked correctly, in the console they are shown as NOT found.
I think instead of
http://frickeln.jensfreyer.de/blog/js-6.1.2/vendor/jquery.min.js
it should link to
http://frickeln.jensfreyer.de/js-6.1.2/vendor/jquery.min.js

Turning off auto-styling for Web Form designer in VS2012

Whenever you are in design mode in VS2012 for editing a Web Form, if you click on anything, and accidentally drag and drop, a CSS auto-style will appear at the top of the HTML for the aspx page.
From some preliminary research, I checked the following:
Tools>Options>HTML Designer>CSS Styling>Style Application Mode, but it was already set to manual. Is there somewhere else I should be looking to disable this functionality?
Right now there is no way to turn off this. We have received this feedback through connect link. Please add vote to this connect bug. And we will consider this in future release of VS.
I also found this, and I have assoicated it rightly or wrongly, with large pages getting totally corrupted (table cell contents being apparrently randomly swapped).
I managed to turn autostyle off by going to Tools>Options>HTML Designer>CSS and selecting 'CSS (inline styles)' for each of the items there.
Autostyling has stopped and (fingers crossed) my latest pages have retained their integrity.
Tools > Options > Web Forms Designer > CSS change all CSS(classes ) to CSS(inline styles)

Facebook custom tab for app

I developing a facebook app for my university's library, the problem is that I want 5 different tabs in my app and every tab, I have used command in index.php file but It show command error. I dun know how can I create tabs or menu in my own app. I have found many tutorials regarding adding tabs in facebook page. But i am unable to find any tutorial which guide me how to write code to create tabs in facebook app.
Someone please help me.
You will have to create an app, before you can add it as a tab to a Facebook page.
https://developers.facebook.com/docs/appsonfacebook/pagetabs/
Perhaps there are some vocabulary / language issues here. Please clarify.
When you say "tab", do you mean five elements that would create five links to the left side FB menu inside a fanpage
or
do you mean a "menu" of five distinct "screenviews" inside one url that creates one link in the left side menu ?
Both can be done.

What are some good patterns for managing a bunch of views/screens in Flex?

I'm building a Flex application with about a dozen different screens. There's relationships between the screens such as when on screen 1, I click on something that is an input to screen 2. Then I might bring up screen 3, then go back to 2 and then bring up screen 4. To make it clear to the user where they are in the application, we'd like to implement a breadcrumbs concept where the user gets to see which screen they are and be able to navigate back up the trail they came from.
So in thinking about how to implement this, it seems to me that I should have a stack of views. Views get pushed onto the stack, then popped off. The breadcrumbs would be a visual depiction of that stack, eg: Home >> Alert 123 >> Customer B Summary >> Customer B Detail
Having said this, I'm trying to come up with a pattern for how to implement this. The obvious starting point would be a mx:ViewStack as a container. Then I'd add views as children and make them visible - effectively "pushing" then onto the view stack. Then to close that screen I'd remove them as children to "pop" them off. This would have to update some stack data structure somewhere that the breadcrumbs would be able to see. In fact the breadcrumbs themselves can modify the stack when the user clicks on an item in the breadcrumbs to jump to.
In any case, I'm going to be working on this but just curious if anybody has anything to share around any patterns/frameworks you've used to manage multiple screens and how they come up and go away and navigate between them that I can use for some ideas.
Seems like a simple thing but in practice it's not always straight-forward.
MVC i think would be helpfull to orgenize your code and have a rebustable application .
There is no 100% design pattern ,most times it is the way you implement it .
I find mvc great when having many views because it keeps your mxml pretty clean and small and when you add features you do it in a pure as class which keeps your code from complicationg.
Just throwing some ideas, hoping it can help ...
Maybe you could use the memento pattern? Or use a command pattern with a CommandStack?

Resources