Questions tagged [routed-events]

a way for a windows presentation foundation (WPF) class to provide notifications to clients when some interesting thing happens to the object.

239 questions
21
votes
3 answers

RoutedEventArgs vs EventArgs

I am learning WPF / Silverlight and saw in an MS vidcast that it is now recommended to use RoutedEventArgs over EventArgs; although it didn't say exactly why. I have a win forms app that uses interfaces for "widgets" in an attempt to not be tied to…
Berryl
  • 12,471
  • 22
  • 98
  • 182
18
votes
2 answers

Is there a way to watch WPF Routed Events?

I was wondering if there's a way to watch all RoutedEvents that are raised in a WPF application. A way to write some info about the events fired to the console would be prefect to see what's going on.
Sorskoot
  • 10,190
  • 6
  • 55
  • 98
17
votes
7 answers

MouseDoubleClick events don't bubble

My scenario, simplified: I have a ListView containing rows of Employees, and in each Employee row, there are buttons "Increase" and "Decrease" adjusting his salary. Pretend that in my program, double-clicking an Employee row means "fire this…
Deestan
  • 16,738
  • 4
  • 32
  • 48
14
votes
3 answers

using attached events with caliburn micro Message.Attach

I'm trying to use caliburn micro message to trigger an attached event that I created: public static class DataChanging { public delegate void DataChangingEventHandler(object sender, DataChangingEventArgs e); public static readonly…
Clueless
  • 1,190
  • 2
  • 14
  • 30
12
votes
1 answer

How can I raise a custom Routed Event from user control?

In my user control I have a button that, when clicked, would raise a custom Routed Event. I've attempted to raise it, but it doesn't get fired in the MainWindow.xaml. Xaml for the button in UserControl:
11
votes
2 answers

WPF: Routed events or regular events?

In WPF we have routed events. When should these be used instead of regular events?
mehdi
10
votes
1 answer

Why e.Handled = true not working?

I have following XAML
Haris Hasan
  • 29,856
  • 10
  • 92
  • 122
9
votes
1 answer

WPF - Events on a ControlTemplate?

Does anyone know why I can't set an event on a control template?? For example, the following line of code will not compile. It does this with any events in a control template.
Rachel
  • 130,264
  • 66
  • 304
  • 490
8
votes
1 answer

What's the difference between a class listener and an instance listener in WPF?

I am trying to wrap my head around some WPF specific stuff, and have yet to find the concrete relation between the UIElement.AddHandler method and the EventManager.RegisterClassHandler method. I have googled a bit and found this interesting MSDN…
user604613
7
votes
1 answer

TextChanged Events - Why does this not result in an infinite loop?

While trying to do something a bit more complicated, I ran across a behavior I don't quite understand. Assume the following code below handling the textChanged event. private void textChanged(object sender, TextChangedEventArgs e) { …
Erik Kerber
  • 5,646
  • 7
  • 38
  • 56
7
votes
1 answer

WPF Custom Routed event question

How do you get two unrelated controls to raise the same custom event? All examples I have seen so far have an event defined within a single control, should I be taking a different approach? Eg. I'd like to raise a custom bubbling event from an…
MJS
  • 155
  • 3
  • 9
7
votes
1 answer

The correct way to do a tunneled event

EDIT: I guess I asked a bit of a XY Problem. I don't really care about getting tunneled events working, what I care about is getting a event raised from the code behind of the parent window to be picked up and reacted to by a control that is a child…
Scott Chamberlain
  • 124,994
  • 33
  • 282
  • 431
6
votes
1 answer

Command Binding Memory Leak in WPF

When i create a user control that has a CommandBinding to a RoutedUICommand im worried that i get memory leaks. scenario: Have a RoutedUICommand as a static in c class where i store my commands Implement the CommandBindings on a user control. Add…
Aran Mulholland
  • 23,555
  • 29
  • 141
  • 228
5
votes
1 answer

Handle Custom RoutedEvent in Event Trigger

I have the following tree MainWindow -> Custom UserControl -> GroupBox -> ViewBox I've added a Custom Routed Event to the UserControl, as : public static readonly RoutedEvent ConnectedEvent = EventManager.RegisterRoutedEvent("Connected",…
Vadym Lenda
  • 127
  • 1
  • 10
5
votes
2 answers

Understanding Routing Events: Why I need both, bubble and tunnel events?

I read this good article about Routed Events, and I understood why we need sometimes bubble Events and sometime we need tunnel Events. What I didn't understand is, when we use the tunnel Event, why after it is handled or reached to the source…
yossharel
  • 1,819
  • 2
  • 23
  • 29
1
2 3
15 16