public Champions() { //NavigationPage.SetHasNavigationBar(this, false); InitializeComponent(); championList = RealmController.getChampions(); listView.ItemsSource = championList; }
protected override void OnAppearing() { base.OnAppearing(); if (championList == null) { championList = RealmController.getChampions(); listView.ItemsSource = championList; } }
// :state-start: start local // OnPressLogin() passes the username to the RealmController, // ScoreCardManager, and LeaderboardManager private static void OnPressLogin() { try { HideAuthenticationUI(); loggedInUser = userInput.value; RealmController.SetLoggedInUser(loggedInUser); ScoreCardManager.SetLoggedInUser(loggedInUser); LeaderboardManager.Instance.SetLoggedInUser(loggedInUser); } catch (Exception ex) { Debug.Log("an exception was thrown:" + ex.Message); } }
// :state-end: // :code-block-end: // :code-block-start: add-sync-register-click-handler // :state-start: sync // OnPressRegister() passes RealmController.OnPressRegister() the values of // the userInput and passInput TextFields in order to register a user private static async void OnPressRegister() { try { var currentPlayer = await RealmController.OnPressRegister(userInput.value, passInput.value); if (currentPlayer != null) { HideAuthenticationUI(); } ScoreCardManager.SetLoggedInUser(currentPlayer.Name); LeaderboardManager.Instance.SetLoggedInUser(currentPlayer.Name); } catch (Exception ex) { Debug.Log("an exception was thrown:" + ex.Message); } }
public SummonerSearch() { NavigationPage.SetHasNavigationBar(this, false); InitializeComponent(); var sd = SessionController.getInstance().summonerData; //look for summoner locally if (sd != null && sd.SummonerId != null) { NavigateToSummonerOverview(sd); } else { var sum = RealmController.getSummonerData(); if (sum != null) { SessionController.getInstance().summonerData = sum; NavigateToSummonerOverview(sum); } } }