private void Button_Click_1(object sender, RoutedEventArgs e) { pageIndex++; MsgVaultSvc.MsgVaultServiceClient client = new MsgVaultSvc.MsgVaultServiceClient(); client.GetEmailsPageCompleted += new EventHandler <GetEmailsPageCompletedEventArgs>(client_GetEmailsPageCompleted); try { client.GetEmailsPageAsync(pageIndex, 20); } catch (Exception exc) { MessageBox.Show(exc.Message); } }
public MainPage() { InitializeComponent(); this.SizeChanged += new SizeChangedEventHandler(Layout_SizeChanged); // load data DataContext = this; //MyCollection = new ObservableCollection<MongoMail>(); pageIndex = 0; //set initial page number MsgVaultSvc.MsgVaultServiceClient client = new MsgVaultSvc.MsgVaultServiceClient(); //client.GetAllEmailsCompleted += new EventHandler<GetAllEmailsCompletedEventArgs>(client_GetAllEmailsCompleted); client.GetEmailsPageCompleted += new EventHandler <GetEmailsPageCompletedEventArgs>(client_GetEmailsPageCompleted); try { //client.GetAllEmailsAsync(); client.GetEmailsPageAsync(0, 20); } catch (Exception exc) { MessageBox.Show(exc.Message); } }