Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    ButtonBase Class

    Namespace: Stride.UI.Controls
    Assembly: Stride.UI.dll

    Represents the base primitive for all the button-like controls

    System.Object → UIElement → Control → ContentControl → ButtonBase
    Derived from ButtonBase: Button ModalElement ToggleButton

    [DataContract("ButtonBase")]
    [DataContractMetadataType(typeof(ButtonBase.ButtonBaseMetadata))]
    [Display(null, "Input")]
    public abstract class ButtonBase : ContentControl, IUIElementUpdate, IUIElementChildren, IIdentifiable
    Name Description
    Constructors
    ButtonBase()

    Create an instance of button.

    Fields
    ClickEvent

    Identifies the Click routed event.

    Properties
    ClickMode

    Gets or sets when the Click event occurs.

    IsPressed

    Gets a value that indicates whether the button is currently down.

    Methods
    OnClick(RoutedEventArgs)

    The class handler of the event Click. This method can be overridden in inherited classes to perform actions common to all instances of a class.

    OnTouchDown(TouchEventArgs)
    OnTouchLeave(TouchEventArgs)
    OnTouchUp(TouchEventArgs)
    Events
    Click

    Occurs when a Button is clicked.

    | Improve this Doc View Source

    Constructors


    ButtonBase()

    Create an instance of button.

    protected ButtonBase()
    | Improve this Doc View Source

    Fields


    ClickEvent

    Identifies the Click routed event.

    public static readonly RoutedEvent<RoutedEventArgs> ClickEvent
    Field Value
    Type Description
    RoutedEvent<RoutedEventArgs>
    | Improve this Doc View Source

    Properties


    ClickMode

    Gets or sets when the Click event occurs.

    [DataMember]
    [Display(null, "Behavior")]
    public ClickMode ClickMode { get; set; }
    Property Value
    Type Description
    ClickMode

    IsPressed

    Gets a value that indicates whether the button is currently down.

    public virtual bool IsPressed { get; protected set; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Methods


    OnClick(RoutedEventArgs)

    The class handler of the event Click. This method can be overridden in inherited classes to perform actions common to all instances of a class.

    protected virtual void OnClick(RoutedEventArgs args)
    Parameters
    Type Name Description
    RoutedEventArgs args

    The arguments of the event


    OnTouchDown(TouchEventArgs)

    protected override void OnTouchDown(TouchEventArgs args)
    Parameters
    Type Name Description
    TouchEventArgs args
    Overrides
    UIElement.OnTouchDown(TouchEventArgs)

    OnTouchLeave(TouchEventArgs)

    protected override void OnTouchLeave(TouchEventArgs args)
    Parameters
    Type Name Description
    TouchEventArgs args
    Overrides
    UIElement.OnTouchLeave(TouchEventArgs)

    OnTouchUp(TouchEventArgs)

    protected override void OnTouchUp(TouchEventArgs args)
    Parameters
    Type Name Description
    TouchEventArgs args
    Overrides
    UIElement.OnTouchUp(TouchEventArgs)
    | Improve this Doc View Source

    Events


    Click

    Occurs when a Button is clicked.

    public event EventHandler<RoutedEventArgs> Click
    Event Type
    Type Description
    System.EventHandler<RoutedEventArgs>
    Remarks

    A click event is bubbling


    Inherited Members

    ContentControl.ContentArrangeMatrixPropertyKey
    ContentControl.Content
    ContentControl.VisualContent
    ContentControl.EnumerateChildren()
    ContentControl.MeasureOverride(Vector3)
    ContentControl.ArrangeOverride(Vector3)
    ContentControl.UpdateWorldMatrix(Matrix, Boolean)
    Control.padding
    Control.Padding
    UIElement.InputCategory
    UIElement.PanelCategory
    UIElement.AppearanceCategory
    UIElement.BehaviorCategory
    UIElement.LayoutCategory
    UIElement.MiscCategory
    UIElement.MarginInternal
    UIElement.ArrangeChanged
    UIElement.LocalMatrixChanged
    UIElement.Id
    UIElement.DependencyProperties
    UIElement.LocalMatrix
    UIElement.BackgroundColor
    UIElement.Opacity
    UIElement.Visibility
    UIElement.ClipToBounds
    UIElement.DrawLayerNumber
    UIElement.IsEnabled
    UIElement.CanBeHitByUser
    UIElement.Width
    UIElement.Height
    UIElement.Depth
    UIElement.Size
    UIElement.HorizontalAlignment
    UIElement.VerticalAlignment
    UIElement.DepthAlignment
    UIElement.Margin
    UIElement.MinimumWidth
    UIElement.MinimumHeight
    UIElement.MinimumDepth
    UIElement.MaximumWidth
    UIElement.MaximumHeight
    UIElement.MaximumDepth
    UIElement.DefaultWidth
    UIElement.DefaultHeight
    UIElement.DefaultDepth
    UIElement.Name
    UIElement.DesiredSize
    UIElement.DesiredSizeWithMargins
    UIElement.IsArrangeValid
    UIElement.IsMeasureValid
    UIElement.WorldMatrix
    UIElement.DepthBias
    UIElement.LayoutingContext
    UIElement.VisualChildrenCollection
    UIElement.InvalidateArrange()
    UIElement.InvalidateMeasure()
    UIElement.OnNameChanged()
    UIElement.IsHierarchyEnabled
    UIElement.IsVisible
    UIElement.IsCollapsed
    UIElement.Parent
    UIElement.VisualParent
    UIElement.VisualChildren
    UIElement.HitableChildren
    UIElement.RenderOpacity
    UIElement.RenderSize
    UIElement.RenderOffsets
    UIElement.ActualWidth
    UIElement.ActualHeight
    UIElement.ActualDepth
    UIElement.IUIElementChildren.Children
    UIElement.Measure(Vector3)
    UIElement.Arrange(Vector3, Boolean)
    UIElement.CollapseOverride()
    UIElement.PropagateCollapseToChild(UIElement)
    UIElement.FindName(String)
    UIElement.SetParent(UIElement, UIElement)
    UIElement.SetVisualParent(UIElement, UIElement)
    UIElement.Intersects(Ray, Vector3)
    UIElement.IUIElementUpdate.Update(GameTime)
    UIElement.IUIElementUpdate.UpdateWorldMatrix(Matrix, Boolean)
    UIElement.IUIElementUpdate.UpdateElementState(Int32)
    UIElement.Update(GameTime)
    UIElement.CalculateSizeWithThickness(Vector3, Thickness)
    UIElement.CalculateSizeWithoutThickness(Vector3, Thickness)
    UIElement.CalculateAdjustmentOffsets(Thickness, Vector3, Vector3)
    UIElement.IsTouched
    UIElement.MouseOverState
    UIElement.RequiresMouseOverUpdate
    UIElement.RaiseEvent(RoutedEventArgs)
    UIElement.AddHandler<T>(RoutedEvent<T>, EventHandler<T>, Boolean)
    UIElement.RemoveHandler<T>(RoutedEvent<T>, EventHandler<T>)
    UIElement.MouseOverStateChanged
    UIElement.PreviewTouchDown
    UIElement.PreviewTouchMove
    UIElement.PreviewTouchUp
    UIElement.TouchDown
    UIElement.TouchEnter
    UIElement.TouchLeave
    UIElement.TouchMove
    UIElement.TouchUp
    UIElement.OnPreviewTouchDown(TouchEventArgs)
    UIElement.OnPreviewTouchMove(TouchEventArgs)
    UIElement.OnPreviewTouchUp(TouchEventArgs)
    UIElement.OnTouchEnter(TouchEventArgs)
    UIElement.OnTouchMove(TouchEventArgs)

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    UIElementExtensions.SetPanelZIndex(UIElement, Int32)
    UIElementExtensions.GetPanelZIndex(UIElement)
    UIElementExtensions.SetCanvasRelativeSize(UIElement, Vector3)
    UIElementExtensions.GetCanvasRelativeSize(UIElement)
    UIElementExtensions.SetCanvasRelativePosition(UIElement, Vector3)
    UIElementExtensions.GetCanvasRelativePosition(UIElement)
    UIElementExtensions.SetCanvasAbsolutePosition(UIElement, Vector3)
    UIElementExtensions.GetCanvasAbsolutePosition(UIElement)
    UIElementExtensions.SetCanvasPinOrigin(UIElement, Vector3)
    UIElementExtensions.GetCanvasPinOrigin(UIElement)
    UIElementExtensions.SetGridColumn(UIElement, Int32)
    UIElementExtensions.GetGridColumn(UIElement)
    UIElementExtensions.SetGridRow(UIElement, Int32)
    UIElementExtensions.GetGridRow(UIElement)
    UIElementExtensions.SetGridLayer(UIElement, Int32)
    UIElementExtensions.GetGridLayer(UIElement)
    UIElementExtensions.SetGridColumnSpan(UIElement, Int32)
    UIElementExtensions.GetGridColumnSpan(UIElement)
    UIElementExtensions.SetGridRowSpan(UIElement, Int32)
    UIElementExtensions.GetGridRowSpan(UIElement)
    UIElementExtensions.SetGridLayerSpan(UIElement, Int32)
    UIElementExtensions.GetGridLayerSpan(UIElement)
    VisualTreeHelper.FindVisualChildOfType<T>(UIElement, String)
    VisualTreeHelper.FindVisualChildrenOfType<T>(UIElement)
    VisualTreeHelper.FindVisualParentOfType<T>(UIElement)
    VisualTreeHelper.FindVisualRoot(UIElement)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation