Esempio n. 1
0
        public ToastConfig SetAction(Action <ToastAction> action)
        {
            var cfg = new ToastAction();

            action(cfg);
            return(this.SetAction(cfg));
        }
Esempio n. 2
0
        public ToastConfig SetAction(ToastAction action)
        {
            this.Action = action;
            if (action.TextColor == null)
            {
                action.TextColor = DefaultActionTextColor;
            }

            return(this);
        }
Esempio n. 3
0
        /// <summary> Gets toast action. </summary>
        /// <exception cref="ArgumentNullException"> Thrown when one or more required arguments are null. </exception>
        /// <param name="action"> The action. </param>
        /// <returns> The toast action. </returns>
        private AcrDialogs.ToastAction GetToastAction(UserDialogToastAction action)
        {
            if (action == null)
            {
                throw new ArgumentNullException(nameof(action));
            }

            var result = new AcrDialogs.ToastAction();

            if (action.Text != null)
            {
                result.Text = action.Text;
            }
            if (action.TextColor != null)
            {
                result.TextColor = action.TextColor;
            }
            if (action.Action != null)
            {
                result.Action = action.Action;
            }

            return(result);
        }
Esempio n. 4
0
 public ToastConfig SetAction(ToastAction action)
 {
     this.Action = action;
     return(this);
 }