コード例 #1
0
        public MapPage()
        {
            InitializeComponent();

            viewModel      = (IMapViewModel)Locator.Current.GetService(typeof(IMapViewModel));
            BindingContext = viewModel;
        }
コード例 #2
0
ファイル: EditorModules.cs プロジェクト: Deijin27/RanseiLink
    public override void Initialise(IServiceGetter modServices)
    {
        base.Initialise(modServices);
        _service  = modServices.Get <IMapService>();
        _nestedVm = modServices.Get <IMapViewModel>();
        var mapComboItems = _service.GetMapIds().Select(i => new SelectorComboBoxItem((int)i, i.ToString())).ToList();

        _viewModel = new SelectorViewModelWithoutScroll(mapComboItems, _nestedVm, id =>
        {
            _currentMap = _service.Retrieve((MapId)id);
            _nestedVm.SetModel(_currentMap);
        },
                                                        id => _service.GetMapIds().Select(i => (int)i).Contains(id));
    }
コード例 #3
0
        private void Application_Startup(object sender, StartupEventArgs args)
        {
            ITelnetClient telnetClient = new TelnetClient();

            model = new Model(telnetClient);
            model.Connect(ConfigurationManager.AppSettings.Get("DEFAULT_IP"), int.Parse(ConfigurationManager.AppSettings.Get("DEFAULT_PORT")));
            model.Start();

            dashboardViewModel = new DashboardViewModel(model);
            mapViewModel       = new MapViewModel(model);

            connectionVM = new ConnectionPanelVM(model);
            errorsVM     = new ErrorsPanelVM(model);
            controellsVM = new ControllersPanelVM(model);
        }
コード例 #4
0
        public SpatialViewer_GDIHost()
        {
            InitializeComponent();

            if (DesignerProperties.GetIsInDesignMode(this))
            {
                _viewModel = new MapViewModel(null);
            }
            else
            {
                _viewModel = new MapViewModel(gdiViewer);
            }
            this.DataContext = _viewModel;

            gdiViewer.AutoViewPort     = chkAutoViewPort.IsChecked.Value;
            gdiViewer.InfoMessageSent += gdiViewer_InfoMessageSent;
        }
コード例 #5
0
        public ApproachViewModel(
            Func <IEsaSegmentDetailsViewModel> esaDetailsComponentFactory,
            Func <IEsaEditViewModel> esaEditViewModelFactory,
            IDeviationCollectionViewModel deviationViewer,
            IMapViewModel mapViewModel,
            IApproachService approachService,
            IWindowManager windowManager,
            IEventAggregator eventAggregator)
        {
            if (esaDetailsComponentFactory == null)
            {
                throw new ArgumentNullException("esaDetailsComponentFactory");
            }
            if (esaEditViewModelFactory == null)
            {
                throw new ArgumentNullException("esaEditViewModelFactory");
            }
            if (deviationViewer == null)
            {
                throw new ArgumentNullException("deviationViewer");
            }
            if (mapViewModel == null)
            {
                throw new ArgumentNullException("mapViewModel");
            }
            if (approachService == null)
            {
                throw new ArgumentNullException("approachService");
            }
            if (windowManager == null)
            {
                throw new ArgumentNullException("windowManager");
            }
            if (eventAggregator == null)
            {
                throw new ArgumentNullException("eventAggregator");
            }

            this.esaDetailsComponentFactory = esaDetailsComponentFactory;
            this.esaEditViewModelFactory    = esaEditViewModelFactory;
            this.deviationViewer            = deviationViewer;
            this.mapViewModel    = mapViewModel;
            this.approachService = approachService;
            this.windowManager   = windowManager;
            this.eventAggregator = eventAggregator;
        }
コード例 #6
0
		public SpatialViewer_GDIHost()
		{
			InitializeComponent();

			if (DesignerProperties.GetIsInDesignMode(this))
			{
				_viewModel = new MapViewModel(null);
			}
			else
			{
				_viewModel = new MapViewModel(gdiViewer);
			}
			this.DataContext = _viewModel;

			gdiViewer.AutoViewPort = chkAutoViewPort.IsChecked.Value;
			gdiViewer.InfoMessageSent += gdiViewer_InfoMessageSent;			
			
		}
コード例 #7
0
        public MainWindowViewModel(IFormViewModel formViewModel, IMapViewModel mapViewModel, IProgressViewModel progressViewModel,
                                   IFileDialogService fileDialogService, IPackageService packageService,
                                   IImportService importservice, ISaveService saveService, ILoadService
                                   loadService, ILogService logService, IWindowService windowService,
                                   IProgressService progressService)
        {
            Loggers.PerformanceLogger.Debug("MainWindowViewModel constructor started");

            this.loadService             = loadService;
            loadService.PackageLoaded   += PackageServiceOnPackageLoaded;
            loadService.PackageUnloaded += OnPackageUnloaded;
            this.saveService             = saveService;
            // this.gisService = gisService;
            this.windowService     = windowService;
            this.fileDialogService = fileDialogService;
            this.packageService    = packageService;
            this.importservice     = importservice;
            this.progressService   = progressService;
            MapViewModel           = mapViewModel;
            FormViewModel          = formViewModel;
            ProgressViewModel      = progressViewModel;

            ShowHideKarteCommand    = new DelegateCommand(() => MapViewModel.IsVisible = !MapViewModel.IsVisible);
            ShowHideFormularCommand = new DelegateCommand(() => FormViewModel.IsVisible = !FormViewModel.IsVisible);

            ExitCommand      = new DelegateCommand(App.Current.Shutdown);
            ImportCommand    = new DelegateCommand(startImportWorker);
            SaveCommand      = new DelegateCommand(() => fileDialogService.ShowSaveDialog(saveService.Save));
            ExportCommand    = new DelegateCommand(exportSingle);
            ExportAllCommand = new DelegateCommand(() => fileDialogService.ShowExportDialog(packageService.Export, true));
            ExportLogCommand = new DelegateCommand(() => fileDialogService.ShowExportLogDialog(logService.ExportLog));
            WindowTitle      = string.Format("{0} v{1}-{2}", LocalizationLocator.MobileLocalization.MainWindowTitle, typeof(MainWindow).Assembly.GetName().Version, VersionPostfix.Postfix);
            MenuItemsVisible = false;
            isEnabled        = true;
            fileDialogService.ImportStart    += new EventHandler(fileDialogServiceImportStart);
            fileDialogService.ImportFinished += new EventHandler(fileDialogServiceImportFinished);
            progressService.OnStart          += progressOnStart;
            progressService.OnStop           += progressOnStop;

            Loggers.PerformanceLogger.Debug("MainWindowViewModel constructor ended");
        }
コード例 #8
0
 public MapRibbonTab(MapRibbonTabViewModel vm)
 {
     InitializeComponent();
     DataContext = _viewModel = vm;
 }
コード例 #9
0
        public MapView(IMapViewModel viewModel)
        {
            InitializeComponent();

            DataContext = viewModel;
        }
コード例 #10
0
 protected MapModel(HexSize sizeHexes, HexSize gridSize, InitializeHex initializeHex, IMapViewModel viewModel)
     : base(sizeHexes, gridSize, initializeHex)
 {
     ViewModel = ViewModel;
     AttachViewModel();
 }