Exemple #1
0
        /// <summary>
        /// Processes the specified form.
        /// </summary>
        /// <param name="customRendererViewModel">The custom renderer view model.</param>
        internal void Process(CustomRendererViewModel customRendererViewModel)
        {
            TraceService.WriteLine("CustomerRendererController::Process");

            this.VisualStudioService.WriteStatusBarMessage(NinjaMessages.NinjaIsRunning);

            try
            {
                TraceService.WriteLine("CustomerRendererController::Process GetTextTemplates");

                IEnumerable <TextTemplateInfo> textTemplates = this.customRendererFactory.GetTextTemplates(
                    customRendererViewModel.RequestedName,
                    this.SettingsService.CustomRendererDirectory,
                    customRendererViewModel.SelectedCustomRendererItem,
                    customRendererViewModel.CodeBlock);

                IEnumerable <string> messages = this.textTemplatingService.AddTextTemplates(
                    NinjaMessages.AddingCustomRenderer,
                    textTemplates);

                //// show the readme.
                this.ShowReadMe("Add Xamarin Forms Custom Renderer", messages);
            }
            catch (Exception exception)
            {
                TraceService.WriteError("Cannot create custom renderer exception=" + exception.Message);
            }
        }
Exemple #2
0
        public CustomRendererPage()
        {
            InitializeComponent();

            var vm = new CustomRendererViewModel();

            vm.Elapsed += () => DisplayAlert("You held the button!", "Yay!", "Cancel");

            BindingContext = vm;
        }
Exemple #3
0
        /// <summary>
        /// Runs this instance.
        /// </summary>
        public void Run()
        {
            TraceService.WriteHeader("CustomerRendererController::Run");

            FrameworkType frameworkType = this.VisualStudioService.GetFrameworkType();

            if (frameworkType.IsXamarinFormsSolutionType())
            {
                this.customRendererFactory.RegisterWizardData();

                WizardFrameViewModel viewModel = this.ShowDialog <WizardFrameViewModel>(new WizardView());

                if (viewModel.Continue)
                {
                    CustomRendererViewModel customRendererViewModel = (CustomRendererViewModel)viewModel.GetWizardStepViewModel("CustomRendererViewModel").ViewModel;

                    this.Process(customRendererViewModel);
                }
            }
            else
            {
                this.ShowNotXamarinFormsSolutionMessage();
            }
        }
        /// <summary>
        /// Processes the specified form.
        /// </summary>
        /// <param name="customRendererViewModel">The custom renderer view model.</param>
        internal void Process(CustomRendererViewModel customRendererViewModel)
        {
            TraceService.WriteLine("CustomerRendererController::Process");

            this.VisualStudioService.WriteStatusBarMessage(NinjaMessages.NinjaIsRunning);

            try
            {
                TraceService.WriteLine("CustomerRendererController::Process GetTextTemplates");

                IEnumerable<TextTemplateInfo> textTemplates = this.customRendererFactory.GetTextTemplates(
                    customRendererViewModel.RequestedName,
                    this.SettingsService.CustomRendererDirectory,
                    customRendererViewModel.SelectedCustomRendererItem,
                    customRendererViewModel.CodeBlock);

                IEnumerable<string> messages = this.textTemplatingService.AddTextTemplates(
                    NinjaMessages.AddingCustomRenderer,
                    textTemplates);

                //// show the readme.
                this.ShowReadMe("Add Xamarin Forms Custom Renderer", messages);
            }
            catch (Exception exception)
            {
                TraceService.WriteError("Cannot create custom renderer exception=" + exception.Message);
            }
        }