protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); Forms.Init(this, bundle); Instance = this; SetContentView(Resource.Layout.Main); var toolbar = FindViewById <Toolbar>(Resource.Id.toolbar); SetSupportActionBar(toolbar); SupportActionBar.Title = "Phoneword"; var mainPage = new PhonewordPage().CreateSupportFragment(this); SupportFragmentManager .BeginTransaction() .Replace(Resource.Id.fragment_frame_layout, mainPage) .Commit(); SupportFragmentManager.BackStackChanged += (sender, e) => { bool hasBack = SupportFragmentManager.BackStackEntryCount > 0; SupportActionBar.SetHomeButtonEnabled(hasBack); SupportActionBar.SetDisplayHomeAsUpEnabled(hasBack); SupportActionBar.Title = hasBack ? "Call History" : "Phoneword"; }; }
void Initialize() { Forms.Init(this); Instance = this; window = new Window("Phoneword"); window.BackButtonPressed += (s, e) => { if (naviFrame.NavigationStack.Count > 1) { naviFrame.Pop(); } else { Exit(); } }; window.Show(); var conformant = new Conformant(window); conformant.Show(); naviFrame = new Naviframe(window); conformant.SetContent(naviFrame); naviFrame.Show(); var mainPage = new PhonewordPage().CreateEvasObject(window); naviFrame.Push(mainPage); }
public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions) { Forms.Init(); Instance = this; _window = new UIWindow(UIScreen.MainScreen.Bounds); UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes { TextColor = UIColor.Black }); var mainPage = new PhonewordPage().CreateViewController(); mainPage.Title = "Phoneword"; _navigation = new UINavigationController(mainPage); _window.RootViewController = _navigation; _window.MakeKeyAndVisible(); return(true); }