FastenUp
Search Results for

    Show / Hide Table of Contents

    Interface IMediator

    The IMediator interface is the base interface for ViewModels. It is a marker for Binders that the class contains bindable properties.

    Namespace: FastenUp.Runtime.Mediators
    Assembly: cs.temp.dll.dll
    Syntax
    public interface IMediator
    Remarks

    For the sake of code generation, the implementation of this interface must marked as partial.

    Examples

    This example shows how to implement a mediator that can be used to bind values.

    public partial class MyMediator : MonoBehaviour, IMediator
    {
        public Bindable{string} Text = new ();
        public BindableEvent OnClick = new ();
    
        private void Awake()
        {
            Text.Value = "Hello World!";
            OnClick.AddListener(() => Debug.Log("Clicked!"));
        }
    }

    See Also

    IBinder
    In This Article
    Back to top Generated by DocFX