Ejemplo n.º 1
0
        private static void ShowInternal(Activity activity, View snackbarHolderView, object content, float duration, ToastImpl toast)
        {
            Snackbar snackbar = null;
            var      selector = activity.GetBindingMemberValue(AttachedMembersDesign.Activity.SnackbarTemplateSelector);

            if (selector != null)
            {
                snackbar = (Snackbar)selector.SelectTemplate(content, snackbarHolderView);
            }
            if (snackbar == null)
            {
                snackbar = Snackbar.Make(snackbarHolderView, content.ToStringSafe("(null)"), (int)duration);
            }
            toast.Show(snackbar, duration);
        }
Ejemplo n.º 2
0
        private void ShowInternal(ToastImpl toast, IDataTemplateSelector selector, View snackbarHolderView, object content, float duration, ToastPosition position, IDataContext context)
        {
            Snackbar snackbar;

            if (selector == null)
            {
                snackbar = Snackbar.Make(snackbarHolderView, content.ToStringSafe("(null)"), (int)duration);
            }
            else
            {
                snackbar = (Snackbar)selector.SelectTemplate(content, snackbarHolderView);
            }
            if (snackbar == null)
            {
                toast.FromToast(_defaultPresenter.ShowAsync(content, duration, position, context));
            }
            else
            {
                toast.Show(snackbar, duration);
            }
        }
 private void ShowInternal(ToastImpl toast, IDataTemplateSelector selector, View snackbarHolderView, object content, float duration, ToastPosition position, IDataContext context)
 {
     Snackbar snackbar;
     if (selector == null)
         snackbar = Snackbar.Make(snackbarHolderView, content.ToStringSafe("(null)"), (int)duration);
     else
         snackbar = (Snackbar)selector.SelectTemplate(content, snackbarHolderView);
     if (snackbar == null)
         toast.FromToast(_defaultPresenter.ShowAsync(content, duration, position, context));
     else
         toast.Show(snackbar, duration);
 }
 private static void ShowInternal(Activity activity, View snackbarHolderView, object content, float duration, ToastImpl toast)
 {
     Snackbar snackbar = null;
     var selector = activity.GetBindingMemberValue(AttachedMembersDesign.Activity.SnackbarTemplateSelector);
     if (selector != null)
         snackbar = (Snackbar) selector.SelectTemplate(content, snackbarHolderView);
     if (snackbar == null)
         snackbar = Snackbar.Make(snackbarHolderView, content.ToStringSafe("(null)"), (int) duration);
     toast.Show(snackbar, duration);
 }