Пример #1
0
        public BonusManagementPage()
        {
            InitializeComponent();

            lb_title.Text = "Bonuses";
            bt_add.Text   = "Add";
            bt_back.Text  = "Back";

            bt_back.Clicked                 += async(x, y) => { await Navigation.PopModalAsync(true); };
            bt_add.Clicked                  += async(x, y) => { await Navigation.PushModalAsync(new AddBonusPage(null), true); };
            lv_bonus.ItemSelected           += async(x, y) => { await Navigation.PushModalAsync(new AddBonusPage((Product)y.SelectedItem), true); };
            pc_company.SelectedIndexChanged += async(x, y) => { await GetProducts(); };


            lv_bonus.HasUnevenRows = true;

            lv_bonus.ItemTemplate = new DataTemplate(() =>
            {
                SalesViewCell customCell = new SalesViewCell();
                customCell.SetBinding(SalesViewCell.TitleProperty, "Title");
                customCell.SetBinding(SalesViewCell.EANProperty, "EAN");
                Binding bonusBinding = new Binding {
                    Path = "Bonus", StringFormat = "{0}"
                };
                customCell.SetBinding(SalesViewCell.BonusProperty, bonusBinding);

                return(customCell);
            });
        }
Пример #2
0
        public SalesPage()
        {
            InitializeComponent();

            lb_company.Text = "Company";
            lb_quant.Text   = "Quantity";
            en_quant.Text   = "1";

            st_quant.Minimum                 = 1;
            st_quant.Maximum                 = 100;
            st_quant.Increment               = 1;
            st_quant.ValueChanged           += (x, y) => { en_quant.Text = y.NewValue.ToString(); };
            pc_company.SelectedIndexChanged += async(x, y) => { await GetProducts(); };
            lv_product.ItemSelected         += async(x, y) => { await AddSell((Product)y.SelectedItem); };
            en_quant.IsEnabled               = false;

            lv_product.HasUnevenRows = true;

            lv_product.ItemTemplate = new DataTemplate(() =>
            {
                SalesViewCell customCell = new SalesViewCell();
                customCell.SetBinding(SalesViewCell.TitleProperty, "Title");
                customCell.SetBinding(SalesViewCell.EANProperty, "EAN");
                Binding bonusBinding = new Binding {
                    Path = "Bonus", StringFormat = "{0}"
                };
                customCell.SetBinding(SalesViewCell.BonusProperty, bonusBinding);

                return(customCell);
            });
        }