public async void Toast(ToastConfig config) { var vm = new ToastViewModel { Message = config.Message, MessageTextColor = config.MessageTextColor, BackgroundColor = config.BackgroundColor, PositionIn = config.Position == ToastPosition.Top ? MoveAnimationOptions.Top : MoveAnimationOptions.Bottom, Tap = PopAction(() => config.OnTap?.Invoke() ) }; var toast = new ToastPage { BindingContext = vm }; await PopupNavigation.Instance.PushAsync(toast); Task.Delay(config.DisplayTime) .ContinueWith(_ => Pop()); }
public void GivenImOnTheToastJs() { this.toastPage = new ToastPage(factory); }