コード例 #1
0
        private async void OnItemSelect(object sender, MouseButtonEventArgs e)
        {
            var selectedItem = ((ListView)sender).SelectedItem as IAnalysisMetadata;

            if (selectedItem != null)
            {
                var logicService = Services.GetService(typeof(IAnalysisLogicService)) as IAnalysisLogicService;
                var dbService    = Services.GetService(typeof(IDatabaseService)) as IDatabaseService;

                var fullAnalysis = dbService.GetFullAnalysis(selectedItem.DatabaseId);

                //Instantiating CommonAnalysisDataPage to obtain the DataGrid of the analysis
                var commonAnalysisDataPage = new CommonAnalysisDataPage(logicService, fullAnalysis);
                DataGridView.Content = commonAnalysisDataPage;

                var yesNoDialog = new CustomYesNoDialog("Do you want to export the selected item?");
                await DialogHost.Show(yesNoDialog);

                if (yesNoDialog.ClosedWithConfirmation)
                {
                    var dataGrid = commonAnalysisDataPage.DataGrid;

                    var exportLocation = Directory.CreateDirectory($@"{Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)}\LinearRegression\Exports");
                    ExportToExcel(selectedItem.Title, dataGrid, exportLocation);

                    ExportCompletedSnackbar.MessageQueue.Enqueue("Export complete!");
                    Process.Start(exportLocation.FullName);
                }
            }
        }
コード例 #2
0
        private void CommonAnalysisData_Expanded(object sender, RoutedEventArgs e)
        {
            var commonData = new CommonAnalysisDataPage(analysisLogicService, analysisModel);

            CADPage.Content = commonData;
        }