DevToys logo DevToys
  • Home
  • Blog
  • Documentation
  • Download
Search Results for

    Show / Hide Table of Contents

    Interface IUISwitch

    A component that represents a changeable switch.

    Inherited Members
    IUIElement.Id
    IUIElement.IsVisible
    IUIElement.IsEnabled
    IUIElement.HorizontalAlignment
    IUIElement.VerticalAlignment
    IUIElement.IsVisibleChanged
    IUIElement.IsEnabledChanged
    IUIElement.HorizontalAlignmentChanged
    IUIElement.VerticalAlignmentChanged
    Namespace: DevToys.Api
    Assembly: DevToys.Api.dll
    Syntax
    public interface IUISwitch : IUIElement

    Properties

    IsOn

    Gets the current state of the switch.

    Declaration
    bool IsOn { get; }
    Property Value
    Type Description
    bool

    OffText

    Gets the text to display when the IsOn is false. Default is "Off".

    Declaration
    string? OffText { get; }
    Property Value
    Type Description
    string

    OnText

    Gets the text to display when the IsOn is true. Default is "On".

    Declaration
    string? OnText { get; }
    Property Value
    Type Description
    string

    Events

    IsOnChanged

    Raised when IsOn is changed.

    Declaration
    event EventHandler? IsOnChanged
    Event Type
    Type Description
    EventHandler

    OffTextChanged

    Raised when OffText is changed.

    Declaration
    event EventHandler? OffTextChanged
    Event Type
    Type Description
    EventHandler

    OnTextChanged

    Raised when OnText is changed.

    Declaration
    event EventHandler? OnTextChanged
    Event Type
    Type Description
    EventHandler

    Extension Methods

    GUI.AlignHorizontally<T>(T, UIHorizontalAlignment)
    GUI.AlignVertically<T>(T, UIVerticalAlignment)
    GUI.Disable<T>(T)
    GUI.Enable<T>(T)
    GUI.Hide<T>(T)
    GUI.Off(IUISwitch)
    GUI.OffText(IUISwitch, string?)
    GUI.On(IUISwitch)
    GUI.OnText(IUISwitch, string?)
    GUI.OnToggle(IUISwitch, Action<bool>?)
    GUI.OnToggle(IUISwitch, Func<bool, ValueTask>?)
    GUI.Show<T>(T)
    LoggingExtensions.Log<T>(T)
    In this article
    DevToys logo © 2024 DevToys