public App() { InitializeComponent(); MainPage = new MainPage(); _mainVm = (MainVm)MainPage.BindingContext; }
private void OnBindingContextChanged(object sender, EventArgs e) { if (_bindingContext != null) { _bindingContext.Alert -= Alert; } _bindingContext = BindingContext as MainVm; if (_bindingContext != null) { _bindingContext.Alert += Alert; } }