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
0
votes
0 answers

How can I notify the containing Window that a certain UserControl it contains invoked an ICommand/RelayCommand/DelegateCommand?

TL/DR: How can I notify the containing Window that a certain UserControl it contains invoked an ICommand/RelayCommand/DelegateCommand ? I want to respond the CanExecuteChanged events in the Window. Expansion: The UserControl:
Tar
  • 8,529
  • 9
  • 56
  • 127
0
votes
1 answer

How to Animate a Control Using the Unloaded Event in WPF

I hate to make another question so soon, but I can't seem to get this to work quite right. I have a UserControl with a StoryBoard set to run when the Unloaded RoutedEvent occurs. However, I also have the code so that it will remove the the…
Skello
  • 333
  • 2
  • 15
0
votes
2 answers

Why I can't pass RoutedEventHandler directly in C#

I got a UserControl where I want an event to be public: public event RoutedEventHandler CloseButtonClicked; But to dispatch to this event, the following doesn't work: public MyUserControl() { InitializeComponent(); closeButton.Click +=…
Cœur
  • 37,241
  • 25
  • 195
  • 267
0
votes
1 answer

WPF list of events

I am learning WPF now. My little programs need events for works correctly. I'm just learning and I know only events, which are in my book. I need your help guys. Where can I find list of events for of WPF program(for example: Click event,…
NewB
  • 344
  • 3
  • 12
0
votes
1 answer

WPF Style Override breaks Validation Error event propagation

I have a custom control that overrides Window: public class Window : System.Windows.Window { static Window() { DefaultStyleKeyProperty.OverrideMetadata(typeof(Window), new System.Windows.FrameworkPropertyMetadata(typeof(Window))); …
Ben McMillan
  • 578
  • 4
  • 12
0
votes
1 answer

How to create and assign events to dynamically loaded gui?

I'm trying to create a WPF application where the users are allowed to create a custom gui dynamically loaded with some xaml files. There are two files needed for this to happen: The main xaml file which contains the gui elements
Woogyface
  • 1
  • 1
0
votes
2 answers

Same click event for both Button and Grid

I read about Routed events today and tried to provide same click event handler for both a normal button and a custom grid button. Stackpanel is handling the routed button click event, and to invoke same handler I am firing a click event from grid's…
AnjumSKhan
  • 9,647
  • 1
  • 26
  • 38
0
votes
1 answer

Routed Tunnel Events in wpf

I have got a question to wpf community here. I am kind of not able to understand Routing Tunnel Events. In my application, I have got a window which contains a tool bar. Window also contains usercontrols. There are some controls in Tool bar like…
Shakti saxena
  • 183
  • 2
  • 19
0
votes
1 answer

How Can I Handle a Parent's RoutedEvent?

I want to handle the TabControl's SelectionChanged event in one of its child TabItems only. How can I do this? I've tried .... and it doesn't work.…
FreddyFlares
  • 473
  • 6
  • 17
0
votes
1 answer

How to cancel a left mouseclick on button release (Preview...Up)

I am developing a dragScrollViewer and are experiencing some weird stuff when using "e.Handled=true" in the OnPreviewMouseLeftButtonUp function. On the left mousedown, it is not known if the user wants to "click" on the below or if he wants to…
Spunk
  • 28
  • 1
  • 7
0
votes
1 answer

What am I missing with this RoutedEvent?

In a custom FrameworkElement (a Shape) I have: public static readonly RoutedEvent DragDeltaEvent = EventManager.RegisterRoutedEvent("DragDelta", RoutingStrategy.Bubble, typeof(DragDeltaEventHandler), typeof(MyShape)); public event…
Gerard
  • 13,023
  • 14
  • 72
  • 125
0
votes
1 answer

How can I position a control at runtime over a another control in a WinRT app?

I have a C# WinRT app. I have a row of thumbnails. When the user presses and holds on a thumbnail I want to "popup" a grid that acts as context menu over the location where the thumbnail is. I have everything working except the positioning of the…
Robert Oschler
  • 14,153
  • 18
  • 94
  • 227
0
votes
1 answer

WPF event routing

I have a grid control which has two child elements (both are canvas), and first canvas overlays the second one. How can I handle mouse down event on background canvas?
Karen
  • 1
0
votes
1 answer

how to stop mouseover routed event to bubble up

I have to stop the mouse over event bubbling for following scenario. One
D J
  • 6,908
  • 13
  • 43
  • 75
0
votes
1 answer

How do I trigger a nested elements animation to play via an event in WPF?

I have this configuration: UserControl - Grid - - Grid - - - Grid.Triggers - - - - EventTrigger (this is where I want to listen for an event on UserControl) - - ...etc I am trying to create a routed event (maybe this I am going the wrong…
LunchMarble
  • 5,079
  • 9
  • 64
  • 94