コード例 #1
0
    /// <summary>
    ///     Display an action sheet dialog from the bottom of the screen.
    /// </summary>
    /// <param name="config">The action sheet configuration.</param>
    public IDisposable ActionSheetBottom(ActionSheetBottomConfig config)
    {
        // If available, call the delegate to see if presenting this dialog is allowed.
        if (MessagingServiceCore.Delegate == null || MessagingServiceCore.Delegate.OnActionSheetBottomRequested(config))
        {
            return(PresentActionSheetBottom(config));
        }

        return(null);
    }
コード例 #2
0
    public void ActionSheetBottom()
    {
        var config = new ActionSheetBottomConfig
        {
            Title            = "Action Sheet Bottom",
            Message          = "Hello world!",
            ItemClickAction  = (item) => MessagingService.Instance.Toast($"Clicked: {item.Message}"),
            CancelButtonText = "Cancel"
        };

        config.Items.Add(new ActionSheetItemConfig {
            Message = "Item 1"
        });
        config.Items.Add(new ActionSheetItemConfig {
            Message = "Item 2"
        });
        config.Items.Add(new ActionSheetItemConfig {
            Message = "Item 3"
        });

        MessagingService.Instance.ActionSheetBottom(config);
    }