void GenerateTabs() { _notebookDistricts?.Destroy(); _notebookDistricts = new Notebook(); foreach (WageDistrictLevelRateViewModel vm in ViewModel.ObservableWageDistrictLevelRateViewModels) { var view = new WageDistrictLevelRateView(vm, true); VBox vbx = new VBox { view }; Box.BoxChild viewBox = (Box.BoxChild)vbx[view]; viewBox.Fill = true; viewBox.Expand = true; var scrolledWindow = new ScrolledWindow { vbx }; Label tabLabel = new Label { UseMarkup = true, Markup = $"{vm.Entity.CarTypeOfUse.GetEnumTitle()} {vm.Entity.WageDistrict.Name}" }; _notebookDistricts.AppendPage(scrolledWindow, tabLabel); } hbxNotebooksWithDistricts.Add(_notebookDistricts); hbxNotebooksWithDistricts.ShowAll(); }
void GenerateTabs() { if (nbDistricts != null) { nbDistricts.Destroy(); } nbDistricts = new Notebook(); foreach (WageDistrictLevelRateViewModel vm in ViewModel.ObservableWageDistrictLevelRateViewModels) { var view = new WageDistrictLevelRateView(vm, true); VBox vbx = new VBox { view }; Box.BoxChild viewBox = (Box.BoxChild)vbx[view]; viewBox.Fill = true; viewBox.Expand = true; var scrolledWindow = new ScrolledWindow { vbx }; Label tabLabel = new Label { UseMarkup = true, Markup = vm.Entity.WageDistrict.Name }; nbDistricts.AppendPage(scrolledWindow, tabLabel); } hbxNotebooksWithDistricts.Add(nbDistricts); hbxNotebooksWithDistricts.ShowAll(); }