コード例 #1
0
        public Task SetState(S newState)
        {
            var source = new TaskCompletionSource <object>();

            updateContext.OnNextUpdate(() =>
            {
                state = newState;
                source.TrySetResult(null);
            });
            return(source.Task);
        }