Exemplo n.º 1
0
 private async void View_LoadView(object sender, EventArgs e)
 {
     view.Loading(true);
     try
     {
         view.ShowProducts(await Task.Run(() => api.GetProducts(args)), api);
     }
     catch (InvalidOperationException ex)
     {
         view.Message(ex.Message);
     }
     finally
     {
         view.Loading(false);
     }
 }
Exemplo n.º 2
0
        private void View_Cancel(object sender, EventArgs e)
        {
            view.ProgressOff();
            view.Message("");
            cts.Cancel();

            cts = new CancellationTokenSource();
            svc = new ClientService(cts.Token);
            view.Message("Операция отменена");
        }