Prashant Cholachagudda
Prashant Cholachagudda

Reputation: 13090

What is the difference between triggers and events in WPF?

What are main difference between Triggers and Events in WPF ? We can do all the stuffs using events, which we can do through triggers, so why we need triggers?

Upvotes: 1

Views: 2135

Answers (2)

CannibalSmith
CannibalSmith

Reputation: 4820

Triggers are declarative. They avoid all the messiness of imperative programming. You won't get null reference exceptions and such with them.

Upvotes: 1

ema
ema

Reputation: 5783

Triggers are for the UI, you define triggers to change some visual style of the controls using only XAML code. Events are more general pourpose and need to be coded in C#/VB.NET

Upvotes: 0

Related Questions