示例#1
0
        async Task ExecutePullToRefreshCommanded()
        {
            AnalyticsHelpers.TrackEvent(AnalyticsConstants.PullToRefreshCommanded);

            await RefreshDataAsync();

            OnLoadingDataFromBackendCompleted();
        }
示例#2
0
        protected override void OnAppearing()
        {
            base.OnAppearing();
            AnalyticsHelpers.TrackEvent(AnalyticsConstants.ListViewPageAppeared);

            _listView.ItemTapped += HandleListViewItemTapped;
            _viewModel.LoadingDataFromBackendCompleted += HandleLoadingDataFromBackendCompleted;
        }
示例#3
0
        protected override void OnAppearing()
        {
            base.OnAppearing();
            AnalyticsHelpers.TrackEvent(AnalyticsConstants.FirstPageOnAppeared);

            _goButton.Clicked       += HandleButtonClicked;
            _listPageButton.Clicked += HandleListPageButtonClicked;
        }
        async Task ExecuteGoButtonTapped()
        {
            AnalyticsHelpers.TrackEvent(AnalyticsConstants.GoButtonTapped, new Dictionary <string, string> {
                { AnalyticsConstants.FirstPageTextEntered, EntryText }
            });

            IsActiityIndicatorRunning = true;

            await Task.Delay(2000);

            IsActiityIndicatorRunning = false;
            LabelText = EntryText;
        }
示例#5
0
        public override async void Login(string userName, string passWord, bool saveUserName)
        {
            base.Login(userName, passWord, saveUserName);

            var success = await DependencyService.Get <ILogin>().CheckLogin(userName, passWord);

            if (success)
            {
                var insightsDict = new Dictionary <string, string> {
                    { "User Type", "NonApprover" },
                    { "Uses TouchId", "Yes" },
                };

                if (saveUserName)
                {
                    await DependencyService.Get <ILogin>().SaveUsername(userName);

                    insightsDict.Add("Saves username", "Yes");
                }
                else
                {
                    insightsDict.Add("Saves username", "No");
                }

                App.IsLoggedIn = true;

                if (Device.OS == TargetPlatform.iOS)
                {
                    await Navigation.PopAsync();
                }
                else
                {
                    await Navigation.PushAsync(new FirstPage(), false);

                    Navigation.RemovePage(this);
                }
            }
            else
            {
                var signUp = await DisplayAlert("Invalid Login", "Sorry, we didn't recoginize the username or password. Feel free to sign up for free if you haven't!", "Sign up", "Try again");

                if (signUp)
                {
                    await Navigation.PushModalAsync(new NewUserSignUpPage());

                    AnalyticsHelpers.TrackEvent("NewUserSignUp", new Dictionary <string, string> {
                        { "ActionPoint", "System Prompt" },
                    });
                }
            }
        }
示例#6
0
        async void HandleListViewItemTapped(object sender, ItemTappedEventArgs e)
        {
            var listView = sender as ListView;
            var tappedListPageDataModel = e.Item as ListPageDataModel;

            AnalyticsHelpers.TrackEvent(AnalyticsConstants.ListViewItemTapped,
                                        new Dictionary <string, string> {
                { AnalyticsConstants.ListViewItemNumber, tappedListPageDataModel.DetailProperty }
            }
                                        );

            await DisplayAlert("Number Tapped", $"You Selected Number {tappedListPageDataModel.DetailProperty}", "OK");

            listView.SelectedItem = null;
        }