Silverlight - How to close a page in Navigation Framework - silverlight

How do you close a page on a Frame when using Navigation Framework? On a Frame I can only find methods GoBack and GoFoward, but no Close or something like that.

I think you can't do that straight, but you can approximate it by using a blank page and collapsing the Frame.
In other words: create an empty Page, with minimal XAML. When you want to 'close' your current page, navigate to your empty page instead (to unload your current page) and set the Visibility of your Frame to Collapsed. This should do what you want.

Related

Go back to N'th "page" of a page in Angular

There is a page with thumbnails. At the bottom there is have a "Show more" button that loads more thumbnails. A user can click on a thumbnail and re-direct the application into details. When the user clicks browser's "back" I would like him to land in the same position as before. How to achieve this without complex routing?
You can achieve something like this using angular-bootstrap-lightbox and the ui-bootstrap pagination. Both are Angular and use common resources
EDIT:
What you're looking for is something along the lines of scroll-sneak, you want to save the scroll position when you redirect to another page and load the last position when you redirect back.
since I could not find any angular directive to do so, you can either
get one and wrap it around a directive, most of them use jQuery
you can make your own.
for example, you can use js to define a queue array and store it in localStorage/sessionStorage, when you redirect "push" the current page location to the queue, when you redirect back, "pop" that last stored position.
Maintain Scroll Position of large HTML page when client returns

WPF: Adorner + Popup = Modal Popup

So here's the idea of it...
I have an application that I am designing with WPF. It has a Main Window with a frame inside to navigate through pages. The navigation aspect is done through the window (kind of like a template with a footer that has the navigation controls) and the pages have the individual content. On certain pages I would like to have an ADD (+) button that causes a popup that has a form inside to add personal information to the database (First name, last name, address, .etc) While this popup is open I would not like them to be able to access any other part of the application until they press OK or CANCEL. I'd like to be able to call this popup from the individual pages unless there is another workaround.
Any ideas or assistance would be appreciated!
some wpf popups Here and Here.

Solution to weird Windows Phone 7 navigation problem

I have a really strange issue relating to how I handle navigation in an application, and that application now being rejected from AppHub (after being successfully approved a number of times on the same code base... grr)
currently I am capturing the first navigation of the application and routing it an "add item" page in the App.cs using the example found here
the user then adds an "item"
the user is taken to the "main" page again, but stay there are there is now 1 "item" to show in a list
the user then can view a "detail" page of this item where they can select to delete the current item. when they do that I redirect them to the "main" page again.
this navigation then fires the same thing that happened in step 1
and they are routed to an "add" page
the problem with the above process, is that if the user hits "back" on the routed page in step 5 they don't go anywhere as they are routed back to the current page (because there are no items on the page previous and this fires the app.cs routing event to take them to the add page). if I did allow for them to go back, the actual first page they would be able to go back to is 3 nav steps back, when they first added the item - as they are on the "add item" page already, this would be pointless.
The apphub store testers say that in this instance, the application should close. I really don't know how the f&*k I am meant to make this happen, as there is no "go back until close" action I can call...
thoughts?
When the user decides to "delete" the current item, you shouldn't navigate forward to the main page, leaving the deleted item in the navigation stack. You should navigate back to the main page. That way the navigation stack will be empty, and if they navigate back again, the app will close.
(The same is true at step 3, of course - when the item is added, navigate back to the main page. You don't want the "add" page as part of the navigation stack; that action has been completed.)
The single best advice I read on WP7 navigation was "if you don't have to, don't use it." I've almost stopped using it all together and just use "MainPage.xaml" for loading/unloading user controls that do this kind of stuff. I completely control the Back button as needed. It has saved me so much headache. The important thing to realize is that the Navigation pages are really just mimicking a website and it's pages - many apps do not fit that paradigm (as they are apps, not websites). So, if you don't have to use Navigation, don't use it.
So in your case, if you just managed everything on MainPage.xaml, you would use a number of If/Then statements in OnBackKeyPress and if one meets your criteria, do an e.Cancel = true; and show/load/etc. your thing. If not, let the app navigate out of itself - i.e. exit.
For tombstoning, just let the OnNavigatedTo in MainPage.xaml handle loading the right user control received from tombstoned information retrieved from Application_Activated.

WPF Custom Navigation Buttons and calling one page from another

I have a window which contains a Frame which references a 'home' page that has buttons on it. When a button is clicked I want another page to show depending on which button was pressed. I attempted to use
NavigationService.Navigate('mynextpage.xaml')
and that works however, I want to use a customized navigation panel. I call
this.ShowsNavigationUI = false;
on my 'home' page but the bar still shows. Is there a way to accomplish what I am trying to do?
My page with the frame is a window so I do not know how to disable the Navigation bar there where I guess it is coming from.
Further testing shows that the ShowsNavigationUI property is false yet the nav bar shows itself in the parent window once there is a second page to go to (showing the 'home' page in the history.
TIA
if i understand you correctly you want to hide the navigation chrome of a Frame, to do so set
<Frame Name="hostFrame" NavigationUIVisibility="Hidden"/>

Silverlight Navigation Application

Is there anyway I can have one mainpage, with tabs, which load child pages in the content area, but also have within the child page another navigation menu which loads siblings into the same content area it itself is in?
This is just a nested navigation frame situation really.
Do not create a second navigation frame. Simply set the datacontext of the hyperlink button on the nested page to the page where your navigation frame is, that way it can be targeted.

Resources