routedevents

WPF Routed events firing?

I have a WPF form with 3 buttons and have routed events on them, commands are binded on start... private void InitCommandBinding(UIElement frameworkElement) { CommandBinding commandBinding; commandBinding = new CommandBinding(ViewModelCommands.Save, Save_Executed, Save_CanExecute); frameworkElement.CommandBindings.Add(com...

Silverlight 3 LoadedEvent routed to ViewModel

My client is trying to hook to a usercontrols Loaded Event in the View Model. Basically they want to know when the controls loaded event triggers inside the view model. They are looking for a way to do it without code behind the xaml. Is this even feasible. I am looking into whether I can route the loaded event to the viewmodel in th...

Button.MouseDown

Hi Guys, I'm relatively new with WPF. I'm trying to understand the difference between MouseDownEvent and PreviewMouseDownEvent. I understand the WPF event strategies and i understand that the MouseDown event is a bubbling event and the PreviewMouseDown is a tunneling event. I also understand the order of which these events are bein...

WPF - Handling a RoutedEvent in the parent for a specific control instance

In my user control I have several textboxes e.g. Textbox1, Textbox2. In the parent I only want to handle KeyDown events raised from Textbox1, not all Textbox I have added a handler in the parent this.AddHandler(TextBox.KeyDownEvent, new RoutedEventHandler(OnTextboxGoToPageKeyDown)); but of course this will handle all KeyDown events ...

WPF: Handling bubbling events only from one specific content

Now I'm about to learn RoutedEvents. I understand bubbling and tunneling and all. But I have a little problem I'm not sure how to handle. I've got a ItemsControl in my own defined UserControl ( inherits TabItem ). This itemsControl could be a ListBox or some selector not decided yet ( depends what is best with this solution ). Now when...

Making WPF user control mark click events as handled

I have a custom controls which propagates the mouse click event up the visual tree and I would like to get rid of this behaviour. Is there a way to mark a routed event (which was raised by button click or other mouse event) as handled from xaml in my UserControl. ...