![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | First Shown event? Is there an equivelent of the Forms 'Shown' event for when a control is first shown? I have a TabControl with several TabItems. Each TabItem contains a TreeView which is populated by a WebService. I only want to call the WebService when the TreeView is displayed for the first time. Thanks Michael |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: First Shown event? Try the Loaded event. "MichaelG" <MichaelG@newsgroups.nospam> wrote in message news:OU%237IHpTGHA.4600@TK2MSFTNGP11.phx.gbl... > Is there an equivelent of the Forms 'Shown' event for when a control is > first shown? > > I have a TabControl with several TabItems. Each TabItem contains a > TreeView which is populated by a WebService. I only want to call the > WebService when the TreeView is displayed for the first time. > > Thanks > Michael > |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: First Shown event? Hi Jason, I've tried that. Loaded seems to get fired for each TabItem and TreeView when the TabControl is rendered. This is from the 'Object Lifetime Events' entry in the SDK:- Loaded is raised next and is tied to either the source hookup (for top level windows) or visual parent hookup (for anything that isn't a window). In the Loaded event you are guaranteed that all child elements of the event source element are constructed, but not that all of their Loaded events has completed. Loaded is fired after the first render is completed. Standard data binding will have occurred prior to Loaded, asynchronous data binding may have occurred. The above seems a little ambiguous. First it says the event is tied to visual parent hookup and then it says it is fired after the element is rendered. I would have thought the TreeViews on the unselected tabs had not been rendered but the event fires anyhow. (n.b. there isn't any databinding set on any of these element) Some sort of PreFirstRender event would be very useful but it doesn't look like WPF has such a thing. Michael "Jason [Mobiform]" <Jason@mobiform.com> wrote in message news:%23$fBzRpTGHA.4384@tk2msftngp13.phx.gbl... > Try the Loaded event. > > > "MichaelG" <MichaelG@newsgroups.nospam> wrote in message > news:OU%237IHpTGHA.4600@TK2MSFTNGP11.phx.gbl... >> Is there an equivelent of the Forms 'Shown' event for when a control is >> first shown? >> >> I have a TabControl with several TabItems. Each TabItem contains a >> TreeView which is populated by a WebService. I only want to call the >> WebService when the TreeView is displayed for the first time. >> >> Thanks >> Michael >> > > |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: First Shown event? The .Initialized event might be what you're looking for. Its just a blind guess on my part, I'm not exactly sure at what point it gets triggered. J "MichaelG" <MichaelG@newsgroups.nospam> wrote in message news:eiGrEYyTGHA.4520@TK2MSFTNGP10.phx.gbl... > Hi Jason, > > I've tried that. Loaded seems to get fired for each TabItem and TreeView > when the TabControl is rendered. > > This is from the 'Object Lifetime Events' entry in the SDK:- > > Loaded is raised next and is tied to either the source hookup (for top > level windows) or visual parent hookup (for anything that isn't a window). > In the Loaded event you are guaranteed that all child elements of the > event source element are constructed, but not that all of their Loaded > events has completed. Loaded is fired after the first render is completed. > Standard data binding will have occurred prior to Loaded, asynchronous > data binding may have occurred. > > The above seems a little ambiguous. First it says the event is tied to > visual parent hookup and then it says it is fired after the element is > rendered. I would have thought the TreeViews on the unselected tabs had > not been rendered but the event fires anyhow. (n.b. there isn't any > databinding set on any of these element) > > Some sort of PreFirstRender event would be very useful but it doesn't look > like WPF has such a thing. > > Michael > > > > "Jason [Mobiform]" <Jason@mobiform.com> wrote in message > news:%23$fBzRpTGHA.4384@tk2msftngp13.phx.gbl... >> Try the Loaded event. >> >> >> "MichaelG" <MichaelG@newsgroups.nospam> wrote in message >> news:OU%237IHpTGHA.4600@TK2MSFTNGP11.phx.gbl... >>> Is there an equivelent of the Forms 'Shown' event for when a control is >>> first shown? >>> >>> I have a TabControl with several TabItems. Each TabItem contains a >>> TreeView which is populated by a WebService. I only want to call the >>> WebService when the TreeView is displayed for the first time. >>> >>> Thanks >>> Michael >>> >> >> > > |
My System Specs![]() |
| | #5 (permalink) |
| Guest | Re: First Shown event? No, Initialized is the first event to fire before Loaded. Thanks anyway. Michael "Jason [Mobiform]" <Jason@mobiform.com> wrote in message news:Ovv1V52TGHA.5172@TK2MSFTNGP12.phx.gbl... > The .Initialized event might be what you're looking for. Its just a blind > guess on my part, I'm not exactly sure at what point it gets triggered. > > J > > > "MichaelG" <MichaelG@newsgroups.nospam> wrote in message > news:eiGrEYyTGHA.4520@TK2MSFTNGP10.phx.gbl... >> Hi Jason, >> >> I've tried that. Loaded seems to get fired for each TabItem and TreeView >> when the TabControl is rendered. >> >> This is from the 'Object Lifetime Events' entry in the SDK:- >> >> Loaded is raised next and is tied to either the source hookup (for top >> level windows) or visual parent hookup (for anything that isn't a >> window). In the Loaded event you are guaranteed that all child elements >> of the event source element are constructed, but not that all of their >> Loaded events has completed. Loaded is fired after the first render is >> completed. Standard data binding will have occurred prior to Loaded, >> asynchronous data binding may have occurred. >> >> The above seems a little ambiguous. First it says the event is tied to >> visual parent hookup and then it says it is fired after the element is >> rendered. I would have thought the TreeViews on the unselected tabs had >> not been rendered but the event fires anyhow. (n.b. there isn't any >> databinding set on any of these element) >> >> Some sort of PreFirstRender event would be very useful but it doesn't >> look like WPF has such a thing. >> >> Michael >> >> >> >> "Jason [Mobiform]" <Jason@mobiform.com> wrote in message >> news:%23$fBzRpTGHA.4384@tk2msftngp13.phx.gbl... >>> Try the Loaded event. >>> >>> >>> "MichaelG" <MichaelG@newsgroups.nospam> wrote in message >>> news:OU%237IHpTGHA.4600@TK2MSFTNGP11.phx.gbl... >>>> Is there an equivelent of the Forms 'Shown' event for when a control is >>>> first shown? >>>> >>>> I have a TabControl with several TabItems. Each TabItem contains a >>>> TreeView which is populated by a WebService. I only want to call the >>>> WebService when the TreeView is displayed for the first time. >>>> >>>> Thanks >>>> Michael >>>> >>> >>> >> >> > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| WMI event - Failed to start event | Pav | PowerShell | 3 | 05-09-2007 06:48 PM |
| BUG: a lot of errors "Event ID 6003 winlogon" in Event Viewer | BillD | Vista General | 1 | 03-28-2007 10:39 AM |
| Windows Event Log fails to translate event description. | Deepak Jha | Vista General | 0 | 12-15-2006 06:30 AM |
| Event Log Event ID 18212 errors | Jerry Witalka | Vista General | 0 | 08-26-2006 02:13 PM |
| Unable to fetch the Event Log - Event Description | Vineet Das | Vista security | 4 | 08-24-2006 01:52 AM |