WPF frame source questions - wpf

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.

Related

Can React do two-way binding with a URL field?

I have a data visualization tool written with React. I want to make sure that the URL for the page always refers to the view that the user is currently looking at, and that when they e.g. pan and zoom, or change display settings, the URL is updated so that it will take them back to the same view if they visit it in the future.
(Google Maps works like this; as you pan and zoom the coordinates in the URL get updated to point to where you are currently looking.)
React has tools like React Router to access URL path components and query parameters, but they seem mostly to be designed around a normal multi-route single-page application. You might <Link> to a different route, but you aren't meant to end up at a different route every time you change a dropdown, or type a character in a textbox, or drag to pan something. If you did, the number of history entries created would be unmanageable.
Is there anything in React that can be used to two-way bind page state fields and fields in the URL, so that React will keep them in sync for me? I want to be able to, in the middle of interacting with my application, copy-paste the URL into a new browser window, and have at least the most important parts of my application state be restored, even when that state doesn't map cleanly to the idea of being "on a page".

WPF VB.NET Frame get result from Page

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.

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

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/

Resources