The text of this article is not in this database — only its details are. The old site it was published on is gone, but the Internet Archive kept a copy: How To: Hook an Event to a Command in XAML with EventCommandSetter
Join the conversation! Your thoughts help the community grow.
Sign in to leave a comment
It is the same account you read, post and publish with — and you will come straight back to this page.
Roland NeubertPosted May 8, 2012, 3:50 AM
Hi, the EventCommandSetter works but it 'sees' the application commands only. Is there a way to get access to the commands of my ViewModel?
Zoltan BarnaPosted Oct 13, 2011, 11:32 AM
Hi! I tried your solution this way, but it doesn't work for me :( . <Style x:Key="BOMItemTextBlockEventSetterStyle" TargetType="{x:Type TextBlock}"> <ecs:EventCommandSetter Event="MouseLeftButtonDown" Handler="{Binding TextBlockMouseLeftButtonDownCommand, RelativeSource={RelativeSource Self}}"/> </Style> I get this error: Cannot find DependencyProperty or PropertyInfo for property named 'Event'. Property names are case sensitive.