private void userClick(object sender, MouseButtonEventArgs e) { if (navController == null) { return; } ProfilePanel profile = new ProfilePanel(); profile.profileScreenName = this.userHandle; navController.pushControl(profile); profile.refreshProfile(); }
private void searchField_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Return) { ProfilesList profilesList = new ProfilesList(); profilesList.twitterAccountToken = twitterAccountToken; profilesList.setTitle("\"" + searchField.Text + "\""); navController.pushControl(profilesList); String query = searchField.Text; BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += (sender2, e2) => { Account twitterAccount = MastodonAPIWrapper.sharedApiWrapper.accountWithToken(twitterAccountToken); dynamic search = MastodonAPIWrapper.sharedApiWrapper.searchUsers(twitterAccount, query, 200); profilesList.list = search; profilesList.convertList(); }; worker.RunWorkerCompleted += (sender2, e2) => { profilesList.renderList(); }; worker.RunWorkerAsync(); } }
private void nameHandleLabel_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { TextBlock nameHandleLabel = (TextBlock)sender; Toot toot = (Toot)nameHandleLabel.DataContext; ProfilePanel panel = new ProfilePanel(); panel.twitterAccountToken = twitterAccountToken; panel.profileUserID = toot.userID; panel.refreshProfile(); navController.pushControl(panel); }
private void Profile_Click(object sender, RoutedEventArgs e) { Grid ctrl = (Grid)sender; Profile profile = (Profile)ctrl.DataContext; ProfilePanel panel = new ProfilePanel(); panel.profileScreenName = profile.handle; panel.profileUserID = profile.accountID; panel.twitterAccountToken = twitterAccountToken; panel.refreshProfile(); navController.pushControl(panel); }
private void Followers_Click(object sender, MouseButtonEventArgs e) { ProfilesList profilesList = new ProfilesList(); profilesList.twitterAccountToken = twitterAccountToken; profilesList.setTitle("Followers"); navController.pushControl(profilesList); BackgroundWorker worker = new BackgroundWorker(); worker.DoWork += (sender2, e2) => { Account twitterAccount = MastodonAPIWrapper.sharedApiWrapper.accountWithToken(twitterAccountToken); dynamic followers = MastodonAPIWrapper.sharedApiWrapper.followersList(twitterAccount, profileUserID, 200); profilesList.profiles = followers; }; worker.RunWorkerCompleted += (sender2, e2) => { profilesList.renderList(); }; worker.RunWorkerAsync(); }