Exemple #1
0
        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());
        }
Exemple #2
0
 public void GivenImOnTheToastJs()
 {
     this.toastPage = new ToastPage(factory);
 }