Esempio n. 1
0
        protected override void OnShown()
        {
            base.OnShown ();

            BindingContext = new BindingContext ();
            Order order = new Order ();

            datepicker.DataBindings.Add ("Date", order, "OrderDate",
                             false, DataSourceUpdateMode.OnPropertyChanged);
            label.DataBindings.Add ("Text", order, "OrderDate");

            datepicker2.DataBindings.Add ("Date", order, "DeliveryDate");
            label2.DataBindings.Add ("Text", order, "DeliveryDate");
        }
Esempio n. 2
0
 public FormsWindow(string title)
     : base(title)
 {
     BindingContext = new BindingContext ();
     Visible = false;
 }
Esempio n. 3
0
 public FormsWindow(WindowType type)
     : base(type)
 {
     BindingContext = new BindingContext ();
     Visible = false;
 }
Esempio n. 4
0
 public FormsWindow(IntPtr raw)
     : base(raw)
 {
     BindingContext = new BindingContext ();
     Visible = false;
 }
Esempio n. 5
0
 //[MonoTODO ("Stub, does nothing")]
 public static void UpdateBinding(BindingContext newBindingContext, Binding binding)
 {
 }
Esempio n. 6
0
        protected override void OnShown()
        {
            base.OnShown ();

            BindingContext = new BindingContext ();

            customers = new List<Customer>() { new Customer() { CompanyID = 1, CompanyName = "Acme Workshop" },
                                                        new Customer() { CompanyID = 2, CompanyName = "Sirius Tech"} };
            formscombobox1.DataSource = customers;
            formscombobox1.DisplayMember = "CompanyName";
            formscombobox1.ValueMember = "CompanyID";

            formslabel1.DataBindings.Add("Text", customers, "CompanyId");

            customers2 = new NotifiedBindingList<Customer>() { new Customer() { CompanyID = 1, CompanyName = "Acme Workshop" },
                                                    new Customer() { CompanyID = 2, CompanyName = "Sirius Tech"} };
            bsrcCustomers = new BindingSource() { DataSource = customers2 };

            formscombobox2.DataSource = bsrcCustomers;
            formscombobox2.DisplayMember = "CompanyName";
            formscombobox2.ValueMember = "CompanyID";

            formslabel2.DataBindings.Add("Text", bsrcCustomers, "CompanyId");

            customers3 = new NotifiedBindingList<Customer>() { new Customer() { CompanyID = 1, CompanyName = "Acme Workshop" },
                                                       new Customer() { CompanyID = 2, CompanyName = "Sirius Tech"} };

            formscomboboxentry1.DataSource = customers3;
            formscomboboxentry1.DisplayMember = "CompanyName";
            formscomboboxentry1.ValueMember = "CompanyID";
            formscomboboxentry1.DataBindings.Add("Text", customers3, "CompanyName", true, DataSourceUpdateMode.OnPropertyChanged);

            formslabel3.DataBindings.Add("Text", customers3, "CompanyId");
            formslabel4.DataBindings.Add("Text", customers3, "CompanyName");

            var bsrcCities = new BindingSource() { DataSource = new NotifiedBindingList<string> { "Warszawa", "Krakow"}};
            //formscombobox3.DataSource = bsrcCities;

            City city = new City ();
            //city.CityName = "Krakow";
            formscombobox3.DataSource = bsrcCities;
            formscombobox3.DataBindings.Add ("SelectedItem", city, "CityName", false, DataSourceUpdateMode.OnPropertyChanged);
            formscombobox3.DataBindings[0].WriteValue();
            labelCityName.DataBindings.Add ("Text", city, "CityName");

            //			formscombobox3.DataSource = bsrcCities;

            city.CityType = CityTypes.City;
            comboboxEnum.DataSource = Enum.GetValues (typeof(CityTypes));
            comboboxEnum.DataBindings.Add ("SelectedItem", city, "CityType", false, DataSourceUpdateMode.OnPropertyChanged);
            //			comboboxEnum.DataSource = Enum.GetValues (typeof(CityTypes));

            labelEnum.DataBindings.Add ("Text", city, "CityType");

            City city2 = new City ();
            comboboxEnum2.DataSource = Enum.GetValues (typeof(CityTypes));
            comboboxEnum2.DataBindings.Add ("SelectedItem", city2, "CityType", false, DataSourceUpdateMode.OnPropertyChanged);
            comboboxEnum2.DataBindings [0].WriteValue ();
            labelEnum2.DataBindings.Add ("Text", city2, "CityType");
        }