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
1
vote
5 answers

wpf textbox won't throw textInput event

I have a window with a textbox that is not throwing textInput events when typing. I have been looking at it with Snooper. Only the KeyDown and KeyUp events get thrown. It IS responding to a few keys: Space, backspace, Insert, home, delete, end It…
Shaboboo
  • 1,347
  • 1
  • 16
  • 35
1
vote
1 answer

Event Handler not removing

I have a routed event handler for a media player to fire an event when the media player opens. When I have just one media element, i can remove the handler just fine. However, when I play two media elements at once with a single mouse click, it…
nikotromus
  • 1,015
  • 16
  • 36
1
vote
1 answer

WPF routed event firing but not being handled by handler

I have the following routed event: public static readonly RoutedEvent ItemMouseDownEvent = EventManager.RegisterRoutedEvent( "ItemMouseDown", RoutingStrategy.Bubble, typeof(ItemMouseDownEventHandler), typeof(BindableGrid)); public delegate void…
ekolis
  • 6,270
  • 12
  • 50
  • 101
1
vote
1 answer

How to make a WPF TextBlock spin whenever its value updates?

I'm trying to spin a TextBlock 360 degrees whenever it's binding updates. From everything I've read the following should work, however it doesn't have any effect. What am I doing wrong?
chillitom
  • 24,888
  • 17
  • 83
  • 118
1
vote
1 answer

How to disable key navigation in a ListBox but keep detect the key press events?

I'm trying to disable the key navigation in a ListBox. I can do it successfully with this code below : private void listClips_PreviewKeyDown(object sender, KeyEventArgs e) { e.Handled = true; } but I wanna add a keyboard shortcut for my…
sword1st
  • 525
  • 3
  • 7
  • 21
1
vote
2 answers

How to not handle a KeyDown Routed Event that has already been handled by eg. a TextBox

I have a Window in WPF with a KeyDown event handler attached. When the user presses a numeric key (0-9) I respond to the event. I use the 0-9 as shortcut keys to select a radiobutton. Eg. pressing key 3 will select the 3'rd radiobutton. The problem…
Ben Anderson
  • 61
  • 1
  • 1
  • 3
1
vote
1 answer

Bubbling events in WPF? Simple Question

This is probably a really easy fix, but I am inexperienced in working with events so I am just going to ask it. I have a ListBox with ListBoxItems in it. These ListBoxItems will be binded to a data source so they will change. I need a MouseDown…
TheJediCowboy
  • 8,924
  • 28
  • 136
  • 208
1
vote
2 answers

Hiding/showing child controls when parent control gains/loses focus

I am creating a text editing control that contains a RichTextArea and a toolbar for formatting. I want the toolbar to only be visible when the control has focus. However I am finding this difficult to pull off in Silverlight, as Silverlight's focus…
Matt Greer
  • 60,826
  • 17
  • 123
  • 123
1
vote
3 answers

Events routing in WPF

I have implemented a UserControl. Then I would like to handle an event that is originally handled by Window (keyboard press). What is the best way to route the event caught by another component (higher in the components' tree)? Thanks in advance for…
Jamie
  • 1,092
  • 3
  • 22
  • 44
1
vote
0 answers

Handling HyperlinkCoulumn Click Event

I have a DataGrid that contains a list of people that have email addresses. What I would like is that when the user clicks on one of the email addresses in the column, a new email is composed in outlook ready for the user to send. I am currently…
CBreeze
  • 2,925
  • 4
  • 38
  • 93
1
vote
1 answer

Handle an event in code behind as well as Invoke a view model's command on some event

Here's the overview : I am using a Custom control (CusCtrl) to show taskbar icon , it also has a Popup property. so when you click on the icon the CusCtrl shows the Popup. I am setting the child of the pop up with a UserControl (lets say UC1). I am…
KhannaB7
  • 265
  • 5
  • 17
1
vote
1 answer

Prevent child controls from receiving routed events

Lets say I have my user-control somewhere in the visual tree. Parent and children are 3rd-party controls that I cannot modify. I want to filter keyboard events in my control so that children controls do not receive some keyboard events, but the…
nevermind
  • 2,300
  • 1
  • 20
  • 36
1
vote
0 answers

Is there anything like, or similar to a routed version of the INPC interface?

Using RoutedEvents, you can do things such as have a single control which hosts thousands of child controls, but rather than subscribe to MouseDown on each child, you set a handler on the root control and inspect the 'sender' property to find which…
Mark A. Donohoe
  • 28,442
  • 25
  • 137
  • 286
1
vote
1 answer

Raising ContextMenuClosing event manually

I'm deriving from ContextMenu and inside the derived class I need to raise the ContextMenuClosing event manually. I tried the following two ways: // On runtime tells me it can't convert from // "System.Windows.RoutedEventArgs" to //…
stefan.at.kotlin
  • 15,347
  • 38
  • 147
  • 270
1
vote
1 answer

Capture KeyDown when event does not reach my control

First: I know that there are literally thousands of answers like: "Add a handler to Keyboard.KeyDownEvent and have fun!". But in my situation this does not work. I have a custom control CustomControl which derives from Canvas but has no Children.…
Rico-E
  • 1,806
  • 2
  • 28
  • 47