public AlertPage() { InitializeComponent(); BindingContext = _viewModel = new AlertViewModel(); var itens = new List <Alert>() { new Alert() { Id = 1, Message = "Você possui uma nova mensagem no Chat.", Type = AlertType.Warning, ProcessingMethod = AlertProcessingMethod.SceneChange, IdImageProcesses = 1 }, new Alert() { Id = 2, Message = "Mudança de cena detectada, verifique.", Type = AlertType.Critical, ProcessingMethod = AlertProcessingMethod.SceneChange, IdImageProcesses = 2 }, new Alert() { Id = 3, Message = "Carro desconhecido detectado, verifique.", Type = AlertType.Critical, ProcessingMethod = AlertProcessingMethod.UnkownCar, IdImageProcesses = 3 }, new Alert() { Id = 4, Message = "Pessoa desconhecida detectada, verifique com urgência!", Type = AlertType.Panic, ProcessingMethod = AlertProcessingMethod.UnkownPeople, IdImageProcesses = 4 } }; _viewModel.Alerts.AddRange(itens); _viewModel.Alerts.CollectionChanged += (sender, e) => { var target = _viewModel.Alerts[_viewModel.Alerts.Count - 1]; AlertListView.ScrollTo(target, ScrollToPosition.End, true); }; }
public override void InstallBindings() { if (!CustomAlertsInstaller.FirstBindingInstalled) { return; } InfoView infoView = BeatSaberUI.CreateViewController <InfoView>(); AlertListView alertListView = BeatSaberUI.CreateViewController <AlertListView>(); AlertEditView alertEditView = BeatSaberUI.CreateViewController <AlertEditView>(); AlertDetailView alertDetailView = BeatSaberUI.CreateViewController <AlertDetailView>(); NavigationController navigationController = BeatSaberUI.CreateViewController <NavigationController>(); CustomAlertsFlowCoordinator customAlertsFlowCoordinator = BeatSaberUI.CreateFlowCoordinator <CustomAlertsFlowCoordinator>(); Container.Bind <ModalStateManager>().AsSingle(); InstallController <InfoView>(infoView); InstallController <AlertListView>(alertListView); InstallController <AlertEditView>(alertEditView); InstallController <AlertDetailView>(alertDetailView); InstallController <NavigationController>(navigationController); InstallController <CustomAlertsFlowCoordinator>(customAlertsFlowCoordinator); }