示例#1
0
        /// <summary>
        /// Создать вьюху для элемента адаптера.
        /// </summary>
        /// <param name="convertView">Convert view.</param>
        /// <param name="parent">Parent.</param>
        /// <param name="context">Context.</param>
        public static View Create(View convertView, ViewGroup parent, Activity context)
        {
            if (context == null)
            {
                return(null);
            }

            var view = convertView;
            StocktakeStoreViewHolder itemView;

            if (view == null)
            {
                itemView = new StocktakeStoreViewHolder();
                view     = context.LayoutInflater.Inflate(
                    Resource.Layout.adapter_stocktake_store_list_element_layout, parent, false);
                itemView.LoadViews(view);
                view.Tag          = itemView;
                itemView._context = context;
            }
            else
            {
                itemView = (StocktakeStoreViewHolder)view.Tag;
            }

            return(view);
        }
#pragma warning restore 649

        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.main);

            StocktakeStoreViewHolder.Create(null, null, this);

            //DirectInjection();
            Injector.InjectViews();
            //Geneticist.Splice(this);
            //Cheeseknife.Bind(this);

            //InjectWrapper("1", Injector.InjectViews);

            //InjectWrapper(Window.DecorView);

            //_myButton.Text = $"TOTAL: {stopwatch.ElapsedMilliseconds} ms";

            _myButton.Text = "s";
            _myButton2?.SetText("s2", TextView.BufferType.Normal);
            _myButton.Click += (sender, args) => StartActivity(typeof(SecondActivity));
            FragmentManager.BeginTransaction().Replace(Resource.Id.contentLayout, MySalesFragment.NewInstance())
            .Commit();
        }