Windows Vista Forums
Vista Forums Home Join Vista Forums Donate 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

Concept of Template Triggers and EventTriggers

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 04-07-2006   #1 (permalink)
HolaMan
Guest


 

Concept of Template Triggers and EventTriggers

Hi All

I am so confused about Template/Style Triggers and EventTriggers.
For previous ones, the Setter will trigger while condition is true.
For the Event ones, actions will take while event occurs.

Template/Style Triggers -----> Setters
EventTriggers -----> Actions ( BeginStoryboard, ..etc)

But I want to use some condition to play storyboard.
I found I can't do this, or I want to use EventTriggers to do some
Setter

Is there any way to do that?
Is there any concept I missed for these two different triggers?

Thanks


My System SpecsSystem Spec
Old 04-08-2006   #2 (permalink)
viliescu
Guest


 

RE: Concept of Template Triggers and EventTriggers

For starting actions when a condition is true use Enter/ExitActions

<Style.Triggers>
<Trigger Property="MyProperty" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
...
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
...

I don't think it's possible to use a setter in an event trigger.
--
Valentin Iliescu [MVP C#]


"HolaMan" wrote:

> Hi All
>
> I am so confused about Template/Style Triggers and EventTriggers.
> For previous ones, the Setter will trigger while condition is true.
> For the Event ones, actions will take while event occurs.
>
> Template/Style Triggers -----> Setters
> EventTriggers -----> Actions ( BeginStoryboard, ..etc)
>
> But I want to use some condition to play storyboard.
> I found I can't do this, or I want to use EventTriggers to do some
> Setter
>
> Is there any way to do that?
> Is there any concept I missed for these two different triggers?
>
> Thanks
>
>

My System SpecsSystem Spec
Old 04-09-2006   #3 (permalink)
HolaMan
Guest


 

Re: Concept of Template Triggers and EventTriggers

Thanks you very mcuh~~~

My System SpecsSystem Spec
Old 04-13-2006   #4 (permalink)
HolaMan
Guest


 

Re: Concept of Template Triggers and EventTriggers

Hi~~

I discovered some sample use Event trigger of Button in XAML to replace
write Event Handler in .cs
EX.
<Button.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<BeginStoryboard>
....
</BeginStoryboard>
</EventTrigger>
</Button.Triggers>

But I think if there is a SetterActions will be nice to use
<Button.Triggers>
<EventTrigger RoutedEvent="Button.Click">
<SetterAction>
<Setter Property="SelectedIndex" Value="1"
Targetname="TabControl"/>
</SetterAction>
</EventTrigger>
</Button.Triggers>

So I want to implement my own SetterAction derived from TriggerBase.
I found I can't do this because of some inaccessible data structure.
Is there any reaons or conflict logics for SetterActions ?

Thanks
Have a nice Day

HolaMan

My System SpecsSystem Spec
Old 04-21-2006   #5 (permalink)
Nick Kramer [MSFT]
Guest


 

Re: Concept of Template Triggers and EventTriggers

Right or wrong (and I've heard arguments both ways), we decided not to
support setters inside event triggers because unlike every other form of
trigger, the setter would continue to apply even after the
style/template/whatever containing the trigger had been removed.

-Nick Kramer [MSFT]

---
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"HolaMan" <reality.chang@gmail.com> wrote in message
news:1144912453.570854.65300@i40g2000cwc.googlegroups.com...
> Hi~~
>
> I discovered some sample use Event trigger of Button in XAML to replace
> write Event Handler in .cs
> EX.
> <Button.Triggers>
> <EventTrigger RoutedEvent="Button.Click">
> <BeginStoryboard>
> ....
> </BeginStoryboard>
> </EventTrigger>
> </Button.Triggers>
>
> But I think if there is a SetterActions will be nice to use
> <Button.Triggers>
> <EventTrigger RoutedEvent="Button.Click">
> <SetterAction>
> <Setter Property="SelectedIndex" Value="1"
> Targetname="TabControl"/>
> </SetterAction>
> </EventTrigger>
> </Button.Triggers>
>
> So I want to implement my own SetterAction derived from TriggerBase.
> I found I can't do this because of some inaccessible data structure.
> Is there any reaons or conflict logics for SetterActions ?
>
> Thanks
> Have a nice Day
>
> HolaMan
>



My System SpecsSystem Spec
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
autorun triggers Scan & Fix beano Vista General 0 05-02-2008 01:54 PM
Proof-of-concept virus gives insight into OpenOffice.org securityfailings Frank Vista General 10 05-23-2007 09:40 PM
IE7 Phishing Hole Info and Proof of Concept released Steve Vista security 1 03-14-2007 10:37 PM
the concept of camera in 3D Daniel Avalon 6 06-05-2006 02:06 AM
RE: EventTriggers not compiling.. Wolf Schmidt [MSFT] Avalon 0 01-10-2006 03:52 PM


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