示例#1
0
        public EffectsPage()
        {
            var effectsEntry = new Entry
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                Placeholder       = EffectsPageConstants.EffectsEntryPlaceholderText,
                AutomationId      = AutomationIdConstants.EffectsEntry
            };

            CustomReturnEffect.SetReturnType(effectsEntry, EntryCustomReturn.Forms.Plugin.Abstractions.ReturnType.Go);
            CustomReturnEffect.SetReturnCommand(effectsEntry, BaseEntryReturnCommand);
            CustomReturnEffect.SetReturnCommandParameter(effectsEntry, EntryConstants.CommandParameterString);

            var canExecuteLabel = new Label
            {
                Text = "Can Execute",
                HorizontalTextAlignment = TextAlignment.Center,
                VerticalTextAlignment   = TextAlignment.Center
            };

            var canExecuteSwitch = new Switch {
                AutomationId = AutomationIdConstants.CanExecuteSwitch
            };

            canExecuteSwitch.Toggled += (sender, e) => BaseEntryReturnCommandCanExecute = e.Value;

            var baseCanExecuteStackLayout = new StackLayout
            {
                Orientation       = StackOrientation.Horizontal,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                Children          =
                {
                    canExecuteLabel,
                    canExecuteSwitch
                }
            };

            Title = PageTitles.Effects;

            Content = new StackLayout
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                Children          =
                {
                    effectsEntry,
                    baseCanExecuteStackLayout
                }
            };
        }
        public EffectsPage()
        {
            var effectsEntry = new Entry
            {
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.Center,
                Placeholder       = EffectsPageConstants.EffectsEntryPlaceholderText,
                AutomationId      = AutomationIdConstants.EffectsEntry
            };

            CustomReturnEffect.SetReturnType(effectsEntry, ReturnType.Go);
            CustomReturnEffect.SetReturnCommand(effectsEntry, new Command <string>(async title => await ExecuteEntryCommand(title)));
            CustomReturnEffect.SetReturnCommandParameter(effectsEntry, EntryConstants.CommandParameterString);

            Title = PageTitles.Effects;

            Content = effectsEntry;
        }