Ejemplo n.º 1
0
        public WebFormsScaffolderDialog(WebFormsCodeGeneratorViewModel viewModel)
        {
            if (viewModel == null)
            {
                throw new ArgumentNullException("viewModel");
            }

            InitializeComponent();

            viewModel.PromptForNewDataContextTypeName += model =>
            {
                var dialog = new NewDataContextDialog(model);
                var result = dialog.ShowModal();
                model.Canceled = !result.HasValue || !result.Value;
            };

            viewModel.Close += result => DialogResult = result;

            DataContext = viewModel;
        }
        public WebFormsScaffolderDialog(WebFormsCodeGeneratorViewModel viewModel)
        {
            if (viewModel == null)
            {
                throw new ArgumentNullException("viewModel");
            }
            
            InitializeComponent();
            
            viewModel.PromptForNewDataContextTypeName += model =>
            {
                var dialog = new NewDataContextDialog(model);
                var result = dialog.ShowModal();
                model.Canceled = !result.HasValue || !result.Value;
            };

            viewModel.Close += result => DialogResult = result;

            DataContext = viewModel;
        }