/// <summary>
 /// 添加产品类型对象
 /// </summary>
 /// <param name="item"></param>
 private void AddProductTypeItem(ProductTypeStateModel item)
 {
     _element.Dispatcher.BeginInvoke(new Action(() =>
     {
         CheckBox btn         = new CheckBox();
         btn.Style            = productTypeStyle;
         btn.DataContext      = item;
         btn.Command          = ProductType;
         btn.CommandParameter = item;
         _spProductTypeList.Children.Add(btn);
     }));
 }
Exemple #2
0
        /// <summary>
        /// 添加产品类型对象
        /// </summary>
        /// <param name="item"></param>
        private void AddProductTypeItem(ProductTypeStateModel item)
        {
            Xamarin.Forms.Button btn = new Xamarin.Forms.Button();

            btn.SetBinding(Xamarin.Forms.Button.TextProperty, new Xamarin.Forms.Binding("ProductTypeName"));
            btn.BackgroundColor  = Xamarin.Forms.Color.Transparent;
            btn.Margin           = new Xamarin.Forms.Thickness(10, 0);
            btn.BindingContext   = item;
            btn.Command          = GoProductType;
            btn.CommandParameter = item;
            _spProductTypeList.Children.Add(btn);
        }