Windows Vista Forums
Vista Forums Home Join Vista Forums Webcasts Windows 7 Forum Vista Tutorials Tags

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.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

First Shown event?

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 03-23-2006   #1 (permalink)
MichaelG
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 SpecsSystem Spec
Old 03-23-2006   #2 (permalink)
Jason [Mobiform]
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 SpecsSystem Spec
Old 03-24-2006   #3 (permalink)
MichaelG
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 SpecsSystem Spec
Old 03-24-2006   #4 (permalink)
Jason [Mobiform]
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 SpecsSystem Spec
Old 03-24-2006   #5 (permalink)
MichaelG
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 SpecsSystem Spec
Closed Thread

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


Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51