/// <summary> /// Create the specified title and text. /// </summary> /// <param name="title"></param> /// <param name="text"></param> /// <param name="popAfter">Will dissappear after popAfter TimeSpan</param> /// <returns></returns> public static Toast Create(string title, string text, TimeSpan popAfter = default, FeedbackEffect pushedFeedback = FeedbackEffect.Info) => new Toast { Title = title, Text = text, PopAfter = popAfter, PushedFeedback = pushedFeedback, IsVisible = true };
/// <summary> /// Create a toast, pointing at the specified target, with title, text, and optional timeout (popAfter) /// </summary> /// <param name="target"></param> /// <param name="title"></param> /// <param name="text"></param> /// <param name="popAfter"></param> /// <returns></returns> public static TargetedToast Create(VisualElement target, string title, string text, TimeSpan popAfter = default, FeedbackEffect pushedFeedback = FeedbackEffect.Info) => new TargetedToast(target) { Title = title, Text = text, PopAfter = popAfter, PushedFeedback = pushedFeedback, IsVisible = true };
/// <summary> /// Create the specified target, title, text, okText, cancelText, okButtonColor, cancelButtonColor, okTextColor and cancelTextColor. /// </summary> /// <returns>The create.</returns> /// <param name="target">Target.</param> /// <param name="title">Title.</param> /// <param name="text">Text.</param> /// <param name="okText">Ok text.</param> /// <param name="cancelText">Cancel text.</param> /// <param name="okButtonColor">Ok button color.</param> /// <param name="cancelButtonColor">Cancel button color.</param> /// <param name="okTextColor">Ok text color.</param> /// <param name="cancelTextColor">Cancel text color.</param> public static PermissionPopup Create(VisualElement target, string title, string text, string okText = "OK", string cancelText = "Cancel", Color okButtonColor = default, Color cancelButtonColor = default, Color okTextColor = default, Color cancelTextColor = default, FeedbackEffect pushedFeedback = FeedbackEffect.Inquiry) { var popup = new PermissionPopup(target) { Title = title, Text = text, OkText = okText, CancelText = cancelText }; if (okTextColor != default) { popup.OkTextColor = okTextColor; } if (okButtonColor != default) { popup.OkButtonColor = okButtonColor; } if (cancelTextColor != default) { popup.CancelTextColor = cancelTextColor; } if (cancelButtonColor != default) { popup.CancelButtonColor = cancelButtonColor; } popup.PushedFeedback = pushedFeedback; popup.IsVisible = true; return(popup); }
/// <summary> /// Create the specified target, title, text, okText, cancelText, okButtonColor, cancelButtonColor, okTextColor and cancelTextColor. /// </summary> /// <returns>The create.</returns> /// <param name="target">Target.</param> /// <param name="title">Title.</param> /// <param name="text">Text.</param> /// <param name="okText">Ok text.</param> /// <param name="okButtonColor">Ok button color.</param> /// <param name="okTextColor">Ok text color.</param> public static Alert Create(VisualElement target, string title, string text, string okText = "OK", Color okButtonColor = default, Color okTextColor = default, FeedbackEffect pushedFeedback = FeedbackEffect.Alert) { var popup = new Alert(target) { Title = title, Text = text, OkText = okText }; if (okTextColor != default) { popup.OkTextColor = okTextColor; } if (okButtonColor != default) { popup.OkButtonColor = okButtonColor; } popup.PushedFeedback = pushedFeedback; popup.IsVisible = true; return(popup); }