예제 #1
0
파일: Button.cs 프로젝트: Scellow/Perspex
 /// <summary>
 /// Starts listening for the Enter key when the button <see cref="IsDefault"/>.
 /// </summary>
 /// <param name="root">The input root.</param>
 private void ListenForDefault(IInputElement root)
 {
     root.AddHandler(InputElement.KeyDownEvent, this.RootKeyDown);
 }
예제 #2
0
 /// <summary>
 /// Starts listening for the Enter key when the button <see cref="IsDefault"/>.
 /// </summary>
 /// <param name="root">The input root.</param>
 private void ListenForDefault(IInputElement root)
 {
     root.AddHandler(KeyDownEvent, RootKeyDown);
 }
예제 #3
0
 /// <summary>
 /// Starts listening for the Escape key when the button <see cref="IsCancel"/>.
 /// </summary>
 /// <param name="root">The input root.</param>
 private void ListenForCancel(IInputElement root)
 {
     root.AddHandler(KeyDownEvent, RootCancelKeyDown);
 }
 // Token: 0x0600304E RID: 12366 RVA: 0x000D90A4 File Offset: 0x000D72A4
 private static void SetUpEventHandler(IInputElement element, RoutedEvent routedEvent, Delegate handler)
 {
     element.RemoveHandler(routedEvent, handler);
     element.AddHandler(routedEvent, handler);
 }
예제 #5
0
 private static void SetUpEventHandler(IInputElement element, RoutedEvent routedEvent, Delegate handler)
 { 
     // 
     // Setting NavigateUri causes navigation event handlers to be set up.
     // Doing this repeatedly would keep adding handlers; therefore remove any handler first. 
     //
     element.RemoveHandler(routedEvent, handler);
     element.AddHandler(routedEvent, handler);
 } 
예제 #6
0
 public static Action Enhance(this IInputElement element, DispatchEventHandler handler)
 {
     element.AddHandler(FluxAction.DispatchEvent, handler);
     return(() => element.RemoveHandler(FluxAction.DispatchEvent, handler));
 }