示例#1
0
        public static MainFragment newInstance(Config config)
        {
            Bundle args = new Bundle();

            args.PutParcelable(EXTRA_CONFIG, config);

            MainFragment fragment = new MainFragment();

            fragment.Arguments = args;
            return(fragment);
        }
        private void launchFragment()
        {
            bool folderMode   = folderModeSwitch.Checked;
            bool multipleMode = multipleModeSwitch.Checked;
            bool cameraOnly   = cameraOnlySwitch.Checked;

            Config config = new Config();

            config.CameraOnly     = cameraOnly;
            config.MultipleMode   = multipleMode;
            config.FolderMode     = folderMode;
            config.ShowCamera     = true;
            config.MaxSize        = 100;
            config.DoneTitle      = "done title";
            config.FolderTitle    = "folder title";
            config.ImageTitle     = "image title";
            config.SavePath       = SavePath.Default;
            config.SelectedImages = new List <Image>();

            SupportFragmentManager
            .BeginTransaction()
            .Replace(Resource.Id.fragment_container, MainFragment.newInstance(config))
            .CommitAllowingStateLoss();
        }