Page/Frame
-
I am working on an app that is organized sort of as a browser with the frame/page construct. I ran across an interesting behavior that I can not find documented. When you use the Initialize event, it gets executed when the page is instantiated. When you use the Loaded event, it gets executed every time the page becomes content of the frame. It makes sense and is sort of alluded to in the Microsoft documentation, but the implication is easily missed as it applies to frame/page. I have run across other interesting aspects of fame/page that are not clearly documented. Is there a good article or book that really describes the frame/page construct? Everything I have found is rather superficial just giving the highlights or stressing navigation. It should be at least 10 pages long and could be a book of well over 100 pages.
So many years of programming I have forgotten more languages than I know.
-
I am working on an app that is organized sort of as a browser with the frame/page construct. I ran across an interesting behavior that I can not find documented. When you use the Initialize event, it gets executed when the page is instantiated. When you use the Loaded event, it gets executed every time the page becomes content of the frame. It makes sense and is sort of alluded to in the Microsoft documentation, but the implication is easily missed as it applies to frame/page. I have run across other interesting aspects of fame/page that are not clearly documented. Is there a good article or book that really describes the frame/page construct? Everything I have found is rather superficial just giving the highlights or stressing navigation. It should be at least 10 pages long and could be a book of well over 100 pages.
So many years of programming I have forgotten more languages than I know.
User controls (and Tabs) do the same thing: repeatedly fire the Loaded event. It's not an issue, unless you're initializing in the Loaded event. In those cases, I use an "is Intialized" flag to avoid redundant processing (among other things). Note that "Loaded" doesn't mean it was being created (every time); it runs every time the user control becomes "active" / available. This information is only available to those that ferret it out themselves; as you have just done.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food
-
User controls (and Tabs) do the same thing: repeatedly fire the Loaded event. It's not an issue, unless you're initializing in the Loaded event. In those cases, I use an "is Intialized" flag to avoid redundant processing (among other things). Note that "Loaded" doesn't mean it was being created (every time); it runs every time the user control becomes "active" / available. This information is only available to those that ferret it out themselves; as you have just done.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food
I like that phrase, "ferret it out". It is a common idiom. I brings to mind the furry little animal that seems to not have a spine and can get into all kinds of places. Per Wikipedia, The name "ferret" is derived from the Latin furittus, meaning "little thief". In this case wiggling around a lot and stealing results from obscure references.
So many years of programming I have forgotten more languages than I know.