예제 #1
0
        public IosActionSheetDialog(IViewLocator viewLocator, ActionSheetDialogConfig config)
            : base(viewLocator)
        {
            _config = config;

            Title   = config.Title;
            Message = null;
            Style   = UIAlertControllerStyle.ActionSheet;
        }
        public Task <string> ShowDialogAsync(ActionSheetDialogConfig config)
        {
            var page = GetLastPageInModalStack();

            return(page.DisplayActionSheet(
                       config.Title,
                       config.CancelButtonText,
                       config.DestructButtonText,
                       config.OptionButtons));
        }
예제 #3
0
        public void Ctor_WithNonEmptyOptions_FillsProperties(
            [CombinatorialValues(null, EmptyString, NonEmptyTitle)] string title,
            [CombinatorialValues(null, EmptyString, NonEmptyCancelButtonText)] string cancelButtonText,
            [CombinatorialValues(null, EmptyString, NonEmptyDestructButtonText)] string destructButtonText)
        {
            var options = new string[] { "Option1", "Option2", "Option3" };
            var actionSheetDialogConfig =
                new ActionSheetDialogConfig(options, title, cancelButtonText, destructButtonText);

            Assert.Equal(options, actionSheetDialogConfig.OptionButtons);
            Assert.Equal(title, actionSheetDialogConfig.Title);
            Assert.Equal(cancelButtonText, actionSheetDialogConfig.CancelButtonText);
            Assert.Equal(destructButtonText, actionSheetDialogConfig.DestructButtonText);
        }
예제 #4
0
        public void Ctor_WithNullOptions_CreatesEmptyOptionsAndFillsOtherProperties(
            [CombinatorialValues(null, EmptyString, NonEmptyTitle)] string title,
            [CombinatorialValues(null, EmptyString, NonEmptyCancelButtonText)] string cancelButtonText,
            [CombinatorialValues(null, EmptyString, NonEmptyDestructButtonText)] string destructButtonText)
        {
            var actionSheetDialogConfig =
                new ActionSheetDialogConfig(null, title, cancelButtonText, destructButtonText);

            Assert.NotNull(actionSheetDialogConfig.OptionButtons);
            Assert.Empty(actionSheetDialogConfig.OptionButtons);

            Assert.Equal(title, actionSheetDialogConfig.Title);
            Assert.Equal(cancelButtonText, actionSheetDialogConfig.CancelButtonText);
            Assert.Equal(destructButtonText, actionSheetDialogConfig.DestructButtonText);
        }
 public DroidActionSheetDialog(ActionSheetDialogConfig config)
 {
     _config = config;
 }
 public virtual Task <string> ShowDialogAsync(ActionSheetDialogConfig config)
 {
     return(new IosActionSheetDialog(_viewLocator, config).ShowAsync());
 }
 public Task <string> ShowDialogAsync(ActionSheetDialogConfig config)
 {
     return(new DroidActionSheetDialog(config).ShowAsync());
 }