예제 #1
0
        public ToastConfig SetAction(Action <ToastAction> action)
        {
            var cfg = new ToastAction();

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

            return(this);
        }
예제 #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);
        }
예제 #4
0
 public ToastConfig SetAction(ToastAction action)
 {
     this.Action = action;
     return(this);
 }