Пример #1
0
        /// <summary>
        /// Setup the commands
        /// </summary>
        private void SetupCommands()
        {
            RemoveCommand = new RelayCommand(RemoveMap, () => CanRemove);

            // Create the command to run an export for the active map
            RunExportCommand = new RelayCommand <object>
                                   ((exportToRun) =>
            {
                var model = exportToRun as ExportViewModel;

                if (model != null)
                {
                    // Do Analytics Tracking
                    LiteAnalyticsTracker.TrackExport(model, LiteAnalyticsTracker.Source.Map);

                    model.Save();
                }
            },
                                   (context) =>
            {
                var model = context as ExportViewModel;
                return(model != null && model.CanRun);
            }
                                   );
        }
Пример #2
0
        /// <summary>
        /// Setup the commands
        /// </summary>
        private void SetupCommands()
        {
            RunCommand    = new RelayCommand(RunQuery, () => CanRun);
            RemoveCommand = new RelayCommand(RemoveQuery, () => CanRemove);

            RunReportCommand = new RelayCommand <object>
                                   ((context) =>
            {
                var model = context as ReportViewModel;

                if (model != null && model.CanRun)
                {
                    model.Run(true, true);

                    // Do Analytics Tracking
                    LiteAnalyticsTracker.TrackReport(model, LiteAnalyticsTracker.Source.Queries);

                    // Do Analytics Tracking
                    LiteAnalyticsTracker.TrackReport(model, LiteAnalyticsTracker.Source.Details);
                }
            },
                                   (context) =>
            {
                var model = context as ReportViewModel;
                return(model != null && model.CanRun);
            });

            RunExportCommand = new RelayCommand <object>
                                   ((context) =>
            {
                var model = context as ExportViewModel;

                if (model != null && model.CanRun)
                {
                    model.Save();

                    // Do Analytics Tracking
                    LiteAnalyticsTracker.TrackExport(model, LiteAnalyticsTracker.Source.Queries);
                }
            },
                                   (context) =>
            {
                var model = context as ExportViewModel;
                return(model != null && model.CanRun);
            });
        }
Пример #3
0
        /// <summary>
        /// Setup the viewmodel commands
        /// </summary>
        private void SetupCommands()
        {
            // Create the command to run a report on the active collection
            RunReportCommand = new RelayCommand <object>
                                   ((reportToRun) =>
            {
                var model = reportToRun as ReportViewModel;

                if (model != null && model.CanRun)
                {
                    // Do Analytics Tracking
                    LiteAnalyticsTracker.TrackReport(model, LiteAnalyticsTracker.Source.ResultList);

                    model.Run(true, true);
                }
            },
                                   (context) =>
            {
                var model = context as ReportViewModel;
                return(model != null);
            }
                                   );

            // Create the command to run an export for the active collection
            RunExportCommand = new RelayCommand <object>
                                   ((exportToRun) =>
            {
                var model = exportToRun as ExportViewModel;

                if (model != null)
                {
                    // Do Analytics Tracking
                    LiteAnalyticsTracker.TrackExport(model, LiteAnalyticsTracker.Source.ResultList);

                    model.Save();
                }
            },
                                   (context) =>
            {
                var model = context as ExportViewModel;
                return(model != null && model.CanRun);
            }
                                   );
        }