示例#1
0
        private async void GenerateReport(List <Trade> tradeIDs)
        {
            if (tradeIDs == null)
            {
                throw new NullReferenceException("tradeIDs");
            }
            if (tradeIDs.Count == 0)
            {
                await DialogService.ShowMessageAsync(this, "Error", "No trades meet the given criteria");

                return;
            }

            var gen = new ReportGenerator();
            ProgressDialogController progressDialog = await DialogService.ShowProgressAsync(this, "Generating Report", "Generating Report");

            var ds = await Task.Run(() => gen.TradeStats(
                                        tradeIDs,
                                        PerformanceReportPageViewModel.ReportSettings,
                                        Settings,
                                        Datasourcer,
                                        _contextFactory,
                                        backtestData: PerformanceReportPageViewModel.BacktestData,
                                        progressDialog: progressDialog));

            progressDialog.CloseAsync().Forget(); //don't await it!

            var window = new PerformanceReportWindow(ds, PerformanceReportPageViewModel.ReportSettings);

            window.Show();
        }
示例#2
0
        private async void GenerateReport(List<int> tradeIDs)
        {
            if (tradeIDs == null) throw new NullReferenceException("tradeIDs");
            if (tradeIDs.Count == 0)
            {
                await DialogService.ShowMessageAsync(this, "Error", "No trades meet the given criteria");
                return;
            }

            var gen = new ReportGenerator();
            ProgressDialogController progressDialog = await DialogService.ShowProgressAsync(this, "Generating Report", "Generating Report");
            var ds = await Task.Run(() => gen.TradeStats(tradeIDs, PerformanceReportPageViewModel.ReportSettings, Datasourcer, progressDialog));
            progressDialog.CloseAsync().Forget(); //don't await it!

            var window = new PerformanceReportWindow(ds, PerformanceReportPageViewModel.ReportSettings);
            window.Show();
        }