Binding Commands

This commit is contained in:
MaddoScientisto 2024-10-14 23:25:35 +02:00
commit 22f7143d6e
4 changed files with 156 additions and 16 deletions

View file

@ -43,6 +43,10 @@ namespace ImageCatalog
Label43 = new Label();
TabControl1 = new TabControl();
TabPage5 = new TabPage();
button1 = new Button();
btnTest = new Button();
bindingSource1 = new BindingSource(components);
dataModelBindingSource = new BindingSource(components);
GroupBox11 = new GroupBox();
Panel3 = new Panel();
rdbNuovoMetodo = new RadioButton();
@ -58,8 +62,6 @@ namespace ImageCatalog
Label1 = new Label();
Label2 = new Label();
txtSorgente = new TextBox();
bindingSource1 = new BindingSource(components);
dataModelBindingSource = new BindingSource(components);
txtDestinazione = new TextBox();
GroupBox8 = new GroupBox();
rdbNumFiles = new RadioButton();
@ -181,11 +183,11 @@ namespace ImageCatalog
dataModelBindingSource1 = new BindingSource(components);
TabControl1.SuspendLayout();
TabPage5.SuspendLayout();
((System.ComponentModel.ISupportInitialize)bindingSource1).BeginInit();
((System.ComponentModel.ISupportInitialize)dataModelBindingSource).BeginInit();
GroupBox11.SuspendLayout();
Panel3.SuspendLayout();
GroupBox3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)bindingSource1).BeginInit();
((System.ComponentModel.ISupportInitialize)dataModelBindingSource).BeginInit();
GroupBox8.SuspendLayout();
GroupBox7.SuspendLayout();
TabPage3.SuspendLayout();
@ -253,6 +255,8 @@ namespace ImageCatalog
//
// TabPage5
//
TabPage5.Controls.Add(button1);
TabPage5.Controls.Add(btnTest);
TabPage5.Controls.Add(GroupBox11);
TabPage5.Controls.Add(GroupBox3);
TabPage5.Controls.Add(GroupBox8);
@ -266,6 +270,34 @@ namespace ImageCatalog
TabPage5.Text = "Generale";
TabPage5.UseVisualStyleBackColor = true;
//
// button1
//
button1.DataBindings.Add(new Binding("Command", bindingSource1, "AsyncTestCommand", true));
button1.Location = new Point(501, 480);
button1.Name = "button1";
button1.Size = new Size(94, 29);
button1.TabIndex = 50;
button1.Text = "Test Async";
button1.UseVisualStyleBackColor = true;
//
// btnTest
//
btnTest.DataBindings.Add(new Binding("Command", bindingSource1, "TestCommand", true));
btnTest.Location = new Point(325, 472);
btnTest.Name = "btnTest";
btnTest.Size = new Size(94, 29);
btnTest.TabIndex = 49;
btnTest.Text = "Test";
btnTest.UseVisualStyleBackColor = true;
//
// bindingSource1
//
bindingSource1.DataSource = dataModelBindingSource;
//
// dataModelBindingSource
//
dataModelBindingSource.DataSource = typeof(ImageCatalog_2.DataModel);
//
// GroupBox11
//
GroupBox11.Controls.Add(Panel3);
@ -379,7 +411,7 @@ namespace ImageCatalog
chkAggiornaSottodirectory.Location = new Point(107, 98);
chkAggiornaSottodirectory.Margin = new Padding(4, 5, 4, 5);
chkAggiornaSottodirectory.Name = "chkAggiornaSottodirectory";
chkAggiornaSottodirectory.Size = new Size(203, 37);
chkAggiornaSottodirectory.Size = new Size(317, 37);
chkAggiornaSottodirectory.TabIndex = 25;
chkAggiornaSottodirectory.Text = "aggiorna le sottodirectory";
//
@ -435,14 +467,6 @@ namespace ImageCatalog
txtSorgente.TabIndex = 0;
txtSorgente.Text = "TextBox1";
//
// bindingSource1
//
bindingSource1.DataSource = dataModelBindingSource;
//
// dataModelBindingSource
//
dataModelBindingSource.DataSource = typeof(ImageCatalog_2.DataModel);
//
// txtDestinazione
//
txtDestinazione.DataBindings.Add(new Binding("Text", bindingSource1, "DestinationPath", true, DataSourceUpdateMode.OnPropertyChanged));
@ -1795,14 +1819,14 @@ namespace ImageCatalog
Load += Form1_Load;
TabControl1.ResumeLayout(false);
TabPage5.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)bindingSource1).EndInit();
((System.ComponentModel.ISupportInitialize)dataModelBindingSource).EndInit();
GroupBox11.ResumeLayout(false);
GroupBox11.PerformLayout();
Panel3.ResumeLayout(false);
Panel3.PerformLayout();
GroupBox3.ResumeLayout(false);
GroupBox3.PerformLayout();
((System.ComponentModel.ISupportInitialize)bindingSource1).EndInit();
((System.ComponentModel.ISupportInitialize)dataModelBindingSource).EndInit();
GroupBox8.ResumeLayout(false);
GroupBox8.PerformLayout();
GroupBox7.ResumeLayout(false);
@ -2305,6 +2329,8 @@ namespace ImageCatalog
private BindingSource dataModelBindingSource;
private BindingSource dataModelBindingSource1;
private BindingSource bindingSource1;
private Button btnTest;
private Button button1;
internal Button btnCreaCatalogoAsync
{