コード例 #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);
 }
コード例 #4
0
 // 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
ファイル: Hyperlink.cs プロジェクト: sjyanxin/WPFSource
 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));
 }