public PhoneTranslatePage() { InitializeComponent(); Title = "Phoneword"; _viewModel = new PhoneTranslateViewModel(App.AppViewModel); _viewModel.CallFailed = async (phoneNumber) => { await DisplayAlert("Could not call", "Could not call '" + phoneNumber + "'.", "Close", null); }; _viewModel.ShowCallHistoryDisplay = () => { var callHistory = new CallHistoryPage(); this.Navigation.PushAsync(callHistory); }; this.BindingContext = _viewModel; }
public void SetupViewModels() { _appViewModel = new MainViewModel (new Mocks.TestDialer ()); _translateViewModel = new PhoneTranslateViewModel (_appViewModel); }