Ejemplo n.º 1
0
        public Button(System.Action clickEvent)
        {
            AddToClassList(ussClassName);

            // Click-once behaviour
            clickable = new PointerClickable(clickEvent);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructs a button with an Action that is triggered when the button is clicked.
        /// </summary>
        /// <param name="clickEvent">The action triggered when the button is clicked.</param>
        /// <remarks>
        /// By default, a single left mouse click triggers the Action. To change the activator, modify <see cref="clickable"/>.
        /// </remarks>
        public Button(System.Action clickEvent)
        {
            AddToClassList(ussClassName);

            // Click-once behaviour
            clickable = new PointerClickable(clickEvent);

            RegisterCallback <NavigationSubmitEvent>(OnNavigationSubmit);
            RegisterCallback <KeyDownEvent>(OnKeyDown);
        }
Ejemplo n.º 3
0
 public void SetAction(System.Action clickEvent, long delay, long interval)
 {
     this.RemoveManipulator(m_Clickable);
     m_Clickable = new PointerClickable(clickEvent, delay, interval);
     this.AddManipulator(m_Clickable);
 }