Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Concept of Template Triggers and EventTriggers

 
 
Old 04-07-2006   #1 (permalink)
HolaMan


 
 

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


 
 

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-10-2006   #3 (permalink)
HolaMan


 
 

Re: Concept of Template Triggers and EventTriggers

Thanks you very mcuh~~~

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


 
 

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]


 
 

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
 

Thread Tools


Similar Threads
Thread Forum
Avalon Concept Windows Live
VISTA FORUM...what a concept!!!! General Discussion
runas.exe - basic concept Vista account administration


Vista Forums 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 Ltd

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