Пример #1
0
        public App()
        {
            var waypointsService = new WaypointsService();
            var groupsService    = new GroupsService(waypointsService);

            GeoLayoutBuildingService = new GeoLayoutBuildingService(waypointsService, groupsService);
            SettingsService          = new SettingsService();

            var importService = new ImportService(
                new List <IGeoImporter>(new [] {
                new GpxImporter()
            }),
                new MultiFileDialogService(Current.MainWindow),
                waypointsService);

            var exportService = new ExportService(
                new List <IGeoExporter>(new [] {
                new GpxExporter()
            }),
                new SaveFileDialogService(Current.MainWindow),
                waypointsService);

            MainViewModel   = new MainViewModel(importService, exportService, waypointsService, groupsService, GeoLayoutBuildingService);
            MapViewModel    = new MapViewModel(waypointsService, groupsService, GeoLayoutBuildingService);
            GroupsViewModel = new GroupsViewModel(groupsService, waypointsService);
        }
Пример #2
0
        public MainViewModel(ImportService importService, ExportService exportService, WaypointsService waypointsService, GroupsService groupsService, GeoLayoutBuildingService layoutBuildingService)
        {
            ImportService            = importService;
            ExportService            = exportService;
            WaypointsService         = waypointsService;
            GroupsService            = groupsService;
            GeoLayoutBuildingService = layoutBuildingService;

            OpenCommand = new DelegateCommand(() => ImportService.ImportWaypoints());
            SaveCommand = new DelegateCommand(() => ExportService.ExportWaypoints());

            //var inputFile = @"C:\Users\Епишкин Дмитрий\Desktop\ВЛУ\keyPoints2.gpx";
            //var importer = new GpxImporter();
            //var keyPoints = importer.ImportWaypoints(inputFile);

            //foreach (var p in keyPoints) {
            //    waypointsService.Waypoints.Add(p);
            //}
        }
Пример #3
0
 public MapViewModel(WaypointsService waypointsService, GroupsService groupsService, GeoLayoutBuildingService geoLayoutBuildingService)
 {
     WaypointsService         = waypointsService;
     GroupsService            = groupsService;
     GeoLayoutBuildingService = geoLayoutBuildingService;
 }