WPF VB.NET Frame get result from Page - wpf

I have an app with the main window's main and only control a Frame. Now I have several pages which am navigating through using the frame's source property. But now what I want to achieve is if a page is done doing what it's supposed to do it returns some form of alert to the root frame control so that another page can be loaded. Am still new to .net and WPF so any help would be highly appreciated.
Also if there is a better way of doing this, am open to suggestions.
thanks in advance.

Actually I realised Page have NavigationService in them, so I could just that to go to another page once the current page is done.

Related

Is there any clean way to animate control between pages?

The request is this:
I have a main frame in my main view, that contains several pages.
The first page is logon page, that contains a logon user control.
My goal is moving to the second page in the same frame, and animate the logon control that will eventually become a welcome panel in the next page.
I want the first page to fade out, and the main page to fade in. that i know to do, but in the same time to animate the relevant control to from one page to another without fading and become a child of the second page?
it sounds very significant to applications like Great UI ATM machines or so.
btw, if you have any suggestions to do it other way besides frame and pages, let me know, please.
Thank you in advance!
You can, please see telerik control for silverlight, there is a control for this work,
and Very helpfulو RadTransitionControl

WPF Navigating From one page to another inside a window

I am trying to write a WPF application. The general outline of the application is as follows: There is a main window(Note that the main window is a full screen application) and there are several pages(Possibly 25) and I want to navigate from one page to another with a button click event on each page. What will be the best way to achieve this?
I have tried creating a Frame on the MainWindow and then use the frame to display pages, but my problem is that I can not navigate from one page to another from a button click on the pages. I am new to this and I would appreciate any help.
You could of at least tried a Google mate, this information is abundant, but because you thought typing a paragraph here was easier, I shall save you the trouble.... http://paulstovell.com/blog/wpf-navigation

Silverlight Page Navigation with usercontrol and MVVM Light

I'm developing a silerlight application and have settled on the MVVM Light framework. One of the things I'm trying to do is create a "LoginStatus" control that can be used on multiple locations because we have different layouts that the pages are grouped into.
My challenge is how to redirect the page from a user control. When the users "logout" I want to redirect them to a different page not just a different View. Anybody have any thoughts or some examples that might do something like this.
Most of the examples I have seen out there just change the status on the current view.
dbl
If you really want to navigate to a new page - i.e. leaving the silverlight application - you can use the Navigate method of the System.Windows.Browser.HtmlWindow class (documentation).
System.Windows.Browser.HtmlPage.Window.Navigate(
new Uri("http://silverlight.net")
);
Otherwise, if you do not want to leave the silverlight application you simply navigate to a default view that informs the user that he is not logged in.
Edit:
For implementing a navigation service in Silverlight see for example this post or this post.

In Silverlight, How can I disable Back and Forward navigation using browser buttons?

I'm using the Navigational Framework in Silverlight 4. I'm starting to believe that this was a mistake as the browser buttons are really screwing things up for users. For instance, when a child window is opened the user believes they can close the window by pressing the back button. It doesn't close the window obviously, it just navigates the parent page back a step. The end result is a messed up data set. I'm fed up with the little control I have over the navigation of my application; forward and back buttons are anachronistic. Web applications don't work that way anymore. Please someone tell me how I can disable their functionality; that is, cancel navigation when it is started from one of these buttons.
Remove this code from your html page which holds your silverlight XAP:
<iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>
This is the history frame.
You will likely have to do this in the actual web/asp.net page, as Silverlight has no real control over the browser.
Some workarounds in this article:
http://lennilobel.wordpress.com/2009/07/26/defeat-the-evil-back-button-in-your-asp-net-applications/

WPF frame source questions

I've created a WPF application with a frame inside. I can attach some other pages to this frame like
frame1.Source = new Uri("Page1.xaml", UriKind.RelativeOrAbsolute);
The question is after loading this page (Page1.xaml) an Load another page in the same frame (Page2.xaml)
is the Page1.xaml disposed automaticly or is it still running in background? I could not find a dispose method for a frame source page. Can anyone explain this please.
Frame is designed to provide the ability for navigating content; the preferred way to package content for navigation is a Page as you are doing. Specifically, the Frame can be navigated with the Navigate methods and will maintain the lifetime of navigation history, where "history" is the keyword here.
Within the history of the navigation, the Frame will not maintain an instance of each Page navigated to avoid excessive memory consumption. Consequently, the state is not remembered when using the Navigation controls and a new instance is created each time the page is navigated to.
In other words, when you navigate away from a page in a frame, the object is disposed.
MSDN has a good read on using Frames.

Resources