routedevents

Custom RoutedEvent as EventTrigger

我的未来我决定 提交于 2019-12-18 08:09:09
问题 I have my own shape class public sealed class MirrorTile : Shape and in this class I added the event public static readonly RoutedEvent SelectedEnterEvent = EventManager.RegisterRoutedEvent("SelectedEnter", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MirrorTile)); public event RoutedEventHandler SelectedEnter { add { this.AddHandler(SelectedEnterEvent, value); } remove { this.RemoveHandler(SelectedEnterEvent, value); } } and want to use it in this way <shapes:MirrorTile>

Wpf stop routing event when MessageBox appear?

一世执手 提交于 2019-12-07 06:13:21
问题 I've PreviewMouseDown event on TreeView in order to determine if user can select other item based on some logic. If the current item data changed, will appear MessageBox that asks the user if he want to discard the changes. if user press YES , I set e.Handled = false; to enable the new selection. and if user press NO, I set e.Handled = true; to cancel the new selection. The problem is that although I set e.Handled = false , the event stop and no selection event occurs on TreeView. Someone has

Wpf stop routing event when MessageBox appear?

浪子不回头ぞ 提交于 2019-12-05 10:26:17
I've PreviewMouseDown event on TreeView in order to determine if user can select other item based on some logic. If the current item data changed, will appear MessageBox that asks the user if he want to discard the changes. if user press YES , I set e.Handled = false; to enable the new selection. and if user press NO, I set e.Handled = true; to cancel the new selection. The problem is that although I set e.Handled = false , the event stop and no selection event occurs on TreeView. Someone has solution for that? Thanks in advance! The focus change to the message box cancels the mouse down event

Button.MouseDown

自闭症网瘾萝莉.ら 提交于 2019-12-04 03:09:04
问题 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 being fired - according to this MSDN overview http://msdn.microsoft.com/en-us/library/ms742806.aspx#routing (there is a diagram with example there). So i tried to code some my

Custom RoutedEvent as EventTrigger

不问归期 提交于 2019-11-29 13:55:50
I have my own shape class public sealed class MirrorTile : Shape and in this class I added the event public static readonly RoutedEvent SelectedEnterEvent = EventManager.RegisterRoutedEvent("SelectedEnter", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(MirrorTile)); public event RoutedEventHandler SelectedEnter { add { this.AddHandler(SelectedEnterEvent, value); } remove { this.RemoveHandler(SelectedEnterEvent, value); } } and want to use it in this way <shapes:MirrorTile> <shapes:MirrorTile.Triggers> <EventTrigger RoutedEvent="SelectedEnter"> <BeginStoryboard Storyboard="