public override void ViewDidLoad() { base.ViewDidLoad(); ViewModel = new NewSchoolClassesViewModel(); ViewModel.SchoolClasses.CollectionChanged += NewSchoolClasses_CollectionChanged; TabBar.Layer.BorderColor = Color.TAB_BORDER_COLOR.ToUIColor().CGColor; TabBar.Layer.BorderWidth = (nfloat)0.5; TabBar.ClipsToBounds = true; TabBar.TintColor = Color.SELECTED_ICON_COLOR.ToUIColor(); TabBar.UnselectedItemTintColor = Color.ICON_COLOR.ToUIColor(); SelectedIndex = INITIALLY_SELECTED_INDEX; LastViewController = SelectedViewController; ViewControllerSelected += (sender, e) => { if (LastViewController == e.ViewController) { if (e.ViewController is IVplanTabContentViewController viewController) { viewController.ResetContent(); } } LastViewController = e.ViewController; }; }
public override void ViewDidLoad() { base.ViewDidLoad(); ViewModel = new NewSchoolClassesViewModel(); var sections = new Collection <ChipSection>() { new ChipSection( null, ViewModel.SchoolClasses, ViewModel.ToggleSchoolClassBookmarkAtIndex ) }; SchoolClassesDataSource = new ChipCollectionViewDataSource(CollectionView, sections); CollectionView.DataSource = SchoolClassesDataSource; SchoolClassesDelegate = new ChipCollectionViewDelegate(sections); CollectionView.Delegate = SchoolClassesDelegate; TitleLabel.Text = NSBundle.MainBundle.LocalizedString("new_school_classes_title", ""); SubTitleLabel.Text = NSBundle.MainBundle.LocalizedString("new_school_classes_subtitle", ""); DoneButtonLabel.Text = NSBundle.MainBundle.LocalizedString("new_school_classses_done_button", ""); }