コード例 #1
0
        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);

            var view = this.BindingInflate(FragmentLayoutId, null);

            _toolbar = view.FindViewById <Toolbar>(Resource.Id.toolbar);
            if (_toolbar != null)
            {
                BaseActivity.SetSupportActionBar(_toolbar);
                BaseActivity.SupportActionBar.SetDisplayHomeAsUpEnabled(true);

                _drawerToggle = new MvxActionBarDrawerToggle(
                    Activity,                               // host Activity
                    BaseActivity.DrawerLayout,              // DrawerLayout object
                    _toolbar,                               // nav drawer icon to replace 'Up' caret
                    Resource.String.drawer_open,            // "open drawer" description
                    Resource.String.drawer_close            // "close drawer" description
                    );
                BaseActivity.DrawerLayout.AddDrawerListener(_drawerToggle);
                _drawerToggle.DrawerIndicatorEnabled = true;
            }

            return(view);
        }